<!-- HTML header for doxygen 1.8.6-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<title>OpenCV: cv::Quat&lt; _Tp &gt; Class Template Reference</title>
<link href="../../opencv.ico" rel="shortcut icon" type="image/x-icon" />
<link href="../../tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../jquery.js"></script>
<script type="text/javascript" src="../../dynsections.js"></script>
<script type="text/javascript" src="../../tutorial-utils.js"></script>
<link href="../../search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../search/searchdata.js"></script>
<script type="text/javascript" src="../../search/search.js"></script>
<script type="text/x-mathjax-config">
  MathJax.Hub.Config({
    extensions: ["tex2jax.js", "TeX/AMSmath.js", "TeX/AMSsymbols.js"],
    jax: ["input/TeX","output/HTML-CSS"],
});
//<![CDATA[
MathJax.Hub.Config(
{
  TeX: {
      Macros: {
          matTT: [ "\\[ \\left|\\begin{array}{ccc} #1 & #2 & #3\\\\ #4 & #5 & #6\\\\ #7 & #8 & #9 \\end{array}\\right| \\]", 9],
          fork: ["\\left\\{ \\begin{array}{l l} #1 & \\mbox{#2}\\\\ #3 & \\mbox{#4}\\\\ \\end{array} \\right.", 4],
          forkthree: ["\\left\\{ \\begin{array}{l l} #1 & \\mbox{#2}\\\\ #3 & \\mbox{#4}\\\\ #5 & \\mbox{#6}\\\\ \\end{array} \\right.", 6],
          forkfour: ["\\left\\{ \\begin{array}{l l} #1 & \\mbox{#2}\\\\ #3 & \\mbox{#4}\\\\ #5 & \\mbox{#6}\\\\ #7 & \\mbox{#8}\\\\ \\end{array} \\right.", 8],
          vecthree: ["\\begin{bmatrix} #1\\\\ #2\\\\ #3 \\end{bmatrix}", 3],
          vecthreethree: ["\\begin{bmatrix} #1 & #2 & #3\\\\ #4 & #5 & #6\\\\ #7 & #8 & #9 \\end{bmatrix}", 9],
          cameramatrix: ["#1 = \\begin{bmatrix} f_x & 0 & c_x\\\\ 0 & f_y & c_y\\\\ 0 & 0 & 1 \\end{bmatrix}", 1],
          distcoeffs: ["(k_1, k_2, p_1, p_2[, k_3[, k_4, k_5, k_6 [, s_1, s_2, s_3, s_4[, \\tau_x, \\tau_y]]]]) \\text{ of 4, 5, 8, 12 or 14 elements}"],
          distcoeffsfisheye: ["(k_1, k_2, k_3, k_4)"],
          hdotsfor: ["\\dots", 1],
          mathbbm: ["\\mathbb{#1}", 1],
          bordermatrix: ["\\matrix{#1}", 1]
      }
  }
}
);
//]]>
</script><script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js"></script>
<link href="../../doxygen.css" rel="stylesheet" type="text/css" />
<link href="../../stylesheet.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<!--#include virtual="/google-search.html"-->
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="../../opencv-logo-small.png"/></td>
  <td style="padding-left: 0.5em;">
   <div id="projectname">OpenCV
   &#160;<span id="projectnumber">4.5.2</span>
   </div>
   <div id="projectbrief">Open Source Computer Vision</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "../../search",false,'Search');
</script>
<script type="text/javascript" src="../../menudata.js"></script>
<script type="text/javascript" src="../../menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('../../',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="../../d2/d75/namespacecv.html">cv</a></li><li class="navelem"><a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pub-static-methods">Static Public Member Functions</a> &#124;
<a href="#pub-attribs">Public Attributes</a> &#124;
<a href="#pub-static-attribs">Static Public Attributes</a> &#124;
<a href="#friends">Friends</a> &#124;
<a href="../../dc/d1e/classcv_1_1Quat-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">cv::Quat&lt; _Tp &gt; Class Template Reference<div class="ingroups"><a class="el" href="../../d0/de1/group__core.html">Core functionality</a></div></div>  </div>
</div><!--header-->
<div class="contents">

<p><code>#include &lt;opencv2/core/quaternion.hpp&gt;</code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a40cb6433e291eac3b32622a3359078b9"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../da/d4a/classcv_1_1Quat.html#a40cb6433e291eac3b32622a3359078b9">Quat</a> ()</td></tr>
<tr class="separator:a40cb6433e291eac3b32622a3359078b9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:acffde8aa7474c625aa57040f47324cdf"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../da/d4a/classcv_1_1Quat.html#acffde8aa7474c625aa57040f47324cdf">Quat</a> (const <a class="el" href="../../d6/dcf/classcv_1_1Vec.html">Vec</a>&lt; _Tp, 4 &gt; &amp;coeff)</td></tr>
<tr class="memdesc:acffde8aa7474c625aa57040f47324cdf"><td class="mdescLeft">&#160;</td><td class="mdescRight">From Vec4d or Vec4f.  <a href="#acffde8aa7474c625aa57040f47324cdf">More...</a><br /></td></tr>
<tr class="separator:acffde8aa7474c625aa57040f47324cdf"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac4f908ea3ad1532f1a438e9b049de408"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../da/d4a/classcv_1_1Quat.html#ac4f908ea3ad1532f1a438e9b049de408">Quat</a> (_Tp <a class="el" href="../../da/d4a/classcv_1_1Quat.html#af261492a691c1f0ae62708564b2f1021">w</a>, _Tp <a class="el" href="../../da/d4a/classcv_1_1Quat.html#ab2fbcb463f79a6b9de87c440e3c09dc7">x</a>, _Tp <a class="el" href="../../da/d4a/classcv_1_1Quat.html#a7fec2f7d0b5928826dd359773643ecdc">y</a>, _Tp <a class="el" href="../../da/d4a/classcv_1_1Quat.html#a6836f50dd74292ad753a51a906200af2">z</a>)</td></tr>
<tr class="memdesc:ac4f908ea3ad1532f1a438e9b049de408"><td class="mdescLeft">&#160;</td><td class="mdescRight">from four numbers.  <a href="#ac4f908ea3ad1532f1a438e9b049de408">More...</a><br /></td></tr>
<tr class="separator:ac4f908ea3ad1532f1a438e9b049de408"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5125ead334093d651bf3ce982490007b"><td class="memItemLeft" align="right" valign="top"><a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt; _Tp &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../da/d4a/classcv_1_1Quat.html#a5125ead334093d651bf3ce982490007b">acos</a> () const</td></tr>
<tr class="memdesc:a5125ead334093d651bf3ce982490007b"><td class="mdescLeft">&#160;</td><td class="mdescRight">return arccos value of this quaternion, arccos could be calculated as: </p><p class="formulaDsp">
\[\arccos(q) = -\frac{\boldsymbol{v}}{||\boldsymbol{v}||}arccosh(q)\]
</p>
<p> where \(\boldsymbol{v} = [x, y, z].\)  <a href="#a5125ead334093d651bf3ce982490007b">More...</a><br /></td></tr>
<tr class="separator:a5125ead334093d651bf3ce982490007b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a67afde4bb8288c5ae606d3aae5b7bb8b"><td class="memItemLeft" align="right" valign="top"><a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt; _Tp &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../da/d4a/classcv_1_1Quat.html#a67afde4bb8288c5ae606d3aae5b7bb8b">acosh</a> () const</td></tr>
<tr class="memdesc:a67afde4bb8288c5ae606d3aae5b7bb8b"><td class="mdescLeft">&#160;</td><td class="mdescRight">return arccosh value of this quaternion, arccosh could be calculated as: </p><p class="formulaDsp">
\[arcosh(q) = \ln(q + \sqrt{q^2 - 1})\]
</p>
<p>.  <a href="#a67afde4bb8288c5ae606d3aae5b7bb8b">More...</a><br /></td></tr>
<tr class="separator:a67afde4bb8288c5ae606d3aae5b7bb8b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa084d62b9e250dffe63b2c940a904765"><td class="memItemLeft" align="right" valign="top"><a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt; _Tp &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../da/d4a/classcv_1_1Quat.html#aa084d62b9e250dffe63b2c940a904765">asin</a> () const</td></tr>
<tr class="memdesc:aa084d62b9e250dffe63b2c940a904765"><td class="mdescLeft">&#160;</td><td class="mdescRight">return arcsin value of this quaternion, arcsin could be calculated as: </p><p class="formulaDsp">
\[\arcsin(q) = -\frac{\boldsymbol{v}}{||\boldsymbol{v}||}arcsinh(q\frac{\boldsymbol{v}}{||\boldsymbol{v}||})\]
</p>
<p> where \(\boldsymbol{v} = [x, y, z].\)  <a href="#aa084d62b9e250dffe63b2c940a904765">More...</a><br /></td></tr>
<tr class="separator:aa084d62b9e250dffe63b2c940a904765"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a12e169c174809e62abbc16dd1bd63a05"><td class="memItemLeft" align="right" valign="top"><a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt; _Tp &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../da/d4a/classcv_1_1Quat.html#a12e169c174809e62abbc16dd1bd63a05">asinh</a> () const</td></tr>
<tr class="memdesc:a12e169c174809e62abbc16dd1bd63a05"><td class="mdescLeft">&#160;</td><td class="mdescRight">return arcsinh value of this quaternion, arcsinh could be calculated as: </p><p class="formulaDsp">
\[arcsinh(q) = \ln(q + \sqrt{q^2 + 1})\]
</p>
<p>.  <a href="#a12e169c174809e62abbc16dd1bd63a05">More...</a><br /></td></tr>
<tr class="separator:a12e169c174809e62abbc16dd1bd63a05"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac21b01e626dc888bdf69d0f1f7d8b060"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../da/d4a/classcv_1_1Quat.html#ac21b01e626dc888bdf69d0f1f7d8b060">assertNormal</a> (_Tp eps=<a class="el" href="../../da/d4a/classcv_1_1Quat.html#a10e3525ee098693c55b6ec47a9ac6c11">CV_QUAT_EPS</a>) const</td></tr>
<tr class="memdesc:ac21b01e626dc888bdf69d0f1f7d8b060"><td class="mdescLeft">&#160;</td><td class="mdescRight">to throw an error if this quaternion is not a unit quaternion.  <a href="#ac21b01e626dc888bdf69d0f1f7d8b060">More...</a><br /></td></tr>
<tr class="separator:ac21b01e626dc888bdf69d0f1f7d8b060"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aee1c99898d16d0954135b8432980004b"><td class="memItemLeft" align="right" valign="top">_Tp&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../da/d4a/classcv_1_1Quat.html#aee1c99898d16d0954135b8432980004b">at</a> (size_t index) const</td></tr>
<tr class="memdesc:aee1c99898d16d0954135b8432980004b"><td class="mdescLeft">&#160;</td><td class="mdescRight">a way to get element.  <a href="#aee1c99898d16d0954135b8432980004b">More...</a><br /></td></tr>
<tr class="separator:aee1c99898d16d0954135b8432980004b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac9f4087dd676854b97f5a8ce63beaa62"><td class="memItemLeft" align="right" valign="top"><a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt; _Tp &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../da/d4a/classcv_1_1Quat.html#ac9f4087dd676854b97f5a8ce63beaa62">atan</a> () const</td></tr>
<tr class="memdesc:ac9f4087dd676854b97f5a8ce63beaa62"><td class="mdescLeft">&#160;</td><td class="mdescRight">return arctan value of this quaternion, arctan could be calculated as: </p><p class="formulaDsp">
\[\arctan(q) = -\frac{\boldsymbol{v}}{||\boldsymbol{v}||}arctanh(q\frac{\boldsymbol{v}}{||\boldsymbol{v}||})\]
</p>
<p> where \(\boldsymbol{v} = [x, y, z].\)  <a href="#ac9f4087dd676854b97f5a8ce63beaa62">More...</a><br /></td></tr>
<tr class="separator:ac9f4087dd676854b97f5a8ce63beaa62"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad818d4a92c0093fd75a7b2750b17a89a"><td class="memItemLeft" align="right" valign="top"><a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt; _Tp &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../da/d4a/classcv_1_1Quat.html#ad818d4a92c0093fd75a7b2750b17a89a">atanh</a> () const</td></tr>
<tr class="memdesc:ad818d4a92c0093fd75a7b2750b17a89a"><td class="mdescLeft">&#160;</td><td class="mdescRight">return arctanh value of this quaternion, arctanh could be calculated as: </p><p class="formulaDsp">
\[arcsinh(q) = \frac{\ln(q + 1) - \ln(1 - q)}{2}\]
</p>
<p>.  <a href="#ad818d4a92c0093fd75a7b2750b17a89a">More...</a><br /></td></tr>
<tr class="separator:ad818d4a92c0093fd75a7b2750b17a89a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aaf7616da34fcea4abdd2c7f76f0e2edc"><td class="memItemLeft" align="right" valign="top"><a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt; _Tp &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../da/d4a/classcv_1_1Quat.html#aaf7616da34fcea4abdd2c7f76f0e2edc">conjugate</a> () const</td></tr>
<tr class="memdesc:aaf7616da34fcea4abdd2c7f76f0e2edc"><td class="mdescLeft">&#160;</td><td class="mdescRight">return the conjugate of this quaternion. </p><p class="formulaDsp">
\[q.conjugate() = (w, -x, -y, -z).\]
</p>
  <a href="#aaf7616da34fcea4abdd2c7f76f0e2edc">More...</a><br /></td></tr>
<tr class="separator:aaf7616da34fcea4abdd2c7f76f0e2edc"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a20cf4c9219906bae81210fd8dc01e176"><td class="memItemLeft" align="right" valign="top"><a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt; _Tp &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../da/d4a/classcv_1_1Quat.html#a20cf4c9219906bae81210fd8dc01e176">cos</a> () const</td></tr>
<tr class="memdesc:a20cf4c9219906bae81210fd8dc01e176"><td class="mdescLeft">&#160;</td><td class="mdescRight">return cos value of this quaternion, cos could be calculated as: </p><p class="formulaDsp">
\[\cos(p) = \cos(w) * \cosh(||\boldsymbol{v}||) - \sin(w)\frac{\boldsymbol{v}}{||\boldsymbol{v}||}\sinh(||\boldsymbol{v}||)\]
</p>
<p> where \(\boldsymbol{v} = [x, y, z].\)  <a href="#a20cf4c9219906bae81210fd8dc01e176">More...</a><br /></td></tr>
<tr class="separator:a20cf4c9219906bae81210fd8dc01e176"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac18ecd261065fa7546bedc9e937121b8"><td class="memItemLeft" align="right" valign="top"><a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt; _Tp &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../da/d4a/classcv_1_1Quat.html#ac18ecd261065fa7546bedc9e937121b8">cosh</a> () const</td></tr>
<tr class="memdesc:ac18ecd261065fa7546bedc9e937121b8"><td class="mdescLeft">&#160;</td><td class="mdescRight">return cosh value of this quaternion, cosh could be calculated as: </p><p class="formulaDsp">
\[\cosh(p) = \cosh(w) * \cos(||\boldsymbol{v}||) + \sinh(w)\frac{\boldsymbol{v}}{||\boldsymbol{v}||}sin(||\boldsymbol{v}||)\]
</p>
<p> where \(\boldsymbol{v} = [x, y, z].\)  <a href="#ac18ecd261065fa7546bedc9e937121b8">More...</a><br /></td></tr>
<tr class="separator:ac18ecd261065fa7546bedc9e937121b8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af498bcbdb751ee90b06f7ce42ff47c6f"><td class="memItemLeft" align="right" valign="top"><a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt; _Tp &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../da/d4a/classcv_1_1Quat.html#af498bcbdb751ee90b06f7ce42ff47c6f">crossProduct</a> (const <a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt; _Tp &gt; &amp;q) const</td></tr>
<tr class="memdesc:af498bcbdb751ee90b06f7ce42ff47c6f"><td class="mdescLeft">&#160;</td><td class="mdescRight">return the crossProduct between \(p = (a, b, c, d) = (a, \boldsymbol{u})\) and \(q = (w, x, y, z) = (w, \boldsymbol{v})\). </p><p class="formulaDsp">
\[p \times q = \frac{pq- qp}{2}.\]
</p>
 <p class="formulaDsp">
\[p \times q = \boldsymbol{u} \times \boldsymbol{v}.\]
</p>
 <p class="formulaDsp">
\[p \times q = (cz-dy)i + (dx-bz)j + (by-xc)k. \]
</p>
  <a href="#af498bcbdb751ee90b06f7ce42ff47c6f">More...</a><br /></td></tr>
<tr class="separator:af498bcbdb751ee90b06f7ce42ff47c6f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a06faebf4b5163be987dcfd4aa463bfed"><td class="memItemLeft" align="right" valign="top">_Tp&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../da/d4a/classcv_1_1Quat.html#a06faebf4b5163be987dcfd4aa463bfed">dot</a> (<a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt; _Tp &gt; q) const</td></tr>
<tr class="memdesc:a06faebf4b5163be987dcfd4aa463bfed"><td class="mdescLeft">&#160;</td><td class="mdescRight">return the dot between quaternion \(q\) and this quaternion.  <a href="#a06faebf4b5163be987dcfd4aa463bfed">More...</a><br /></td></tr>
<tr class="separator:a06faebf4b5163be987dcfd4aa463bfed"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:acb646a572c605b3ea5d5b08bb2fb3aa1"><td class="memItemLeft" align="right" valign="top"><a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt; _Tp &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../da/d4a/classcv_1_1Quat.html#acb646a572c605b3ea5d5b08bb2fb3aa1">exp</a> () const</td></tr>
<tr class="memdesc:acb646a572c605b3ea5d5b08bb2fb3aa1"><td class="mdescLeft">&#160;</td><td class="mdescRight">return the value of exponential value. </p><p class="formulaDsp">
\[\exp(q) = e^w (\cos||\boldsymbol{v}||+ \frac{v}{||\boldsymbol{v}||}\sin||\boldsymbol{v}||)\]
</p>
<p> where \(\boldsymbol{v} = [x, y, z].\)  <a href="#acb646a572c605b3ea5d5b08bb2fb3aa1">More...</a><br /></td></tr>
<tr class="separator:acb646a572c605b3ea5d5b08bb2fb3aa1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a305053004bb816fe41062fcb2fd0f6d7"><td class="memItemLeft" align="right" valign="top">_Tp&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../da/d4a/classcv_1_1Quat.html#a305053004bb816fe41062fcb2fd0f6d7">getAngle</a> (<a class="el" href="../../d0/de1/group__core.html#ga935c8234953e2a2c8557c019ad8d509e">QuatAssumeType</a> assumeUnit=<a class="el" href="../../d0/de1/group__core.html#gga935c8234953e2a2c8557c019ad8d509ea786f758552bf7be9ee5f12ca2157cf8f">QUAT_ASSUME_NOT_UNIT</a>) const</td></tr>
<tr class="memdesc:a305053004bb816fe41062fcb2fd0f6d7"><td class="mdescLeft">&#160;</td><td class="mdescRight">get the angle of quaternion, it returns the rotation angle.  <a href="#a305053004bb816fe41062fcb2fd0f6d7">More...</a><br /></td></tr>
<tr class="separator:a305053004bb816fe41062fcb2fd0f6d7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aedc187e57a36dc8bd6fd1ac23f5bd1f1"><td class="memItemLeft" align="right" valign="top"><a class="el" href="../../d6/dcf/classcv_1_1Vec.html">Vec</a>&lt; _Tp, 3 &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../da/d4a/classcv_1_1Quat.html#aedc187e57a36dc8bd6fd1ac23f5bd1f1">getAxis</a> (<a class="el" href="../../d0/de1/group__core.html#ga935c8234953e2a2c8557c019ad8d509e">QuatAssumeType</a> assumeUnit=<a class="el" href="../../d0/de1/group__core.html#gga935c8234953e2a2c8557c019ad8d509ea786f758552bf7be9ee5f12ca2157cf8f">QUAT_ASSUME_NOT_UNIT</a>) const</td></tr>
<tr class="memdesc:aedc187e57a36dc8bd6fd1ac23f5bd1f1"><td class="mdescLeft">&#160;</td><td class="mdescRight">get the axis of quaternion, it returns a vector of length 3.  <a href="#aedc187e57a36dc8bd6fd1ac23f5bd1f1">More...</a><br /></td></tr>
<tr class="separator:aedc187e57a36dc8bd6fd1ac23f5bd1f1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a490a6eb0ebee1ced3b6e1d84a8e9d48d"><td class="memItemLeft" align="right" valign="top"><a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt; _Tp &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../da/d4a/classcv_1_1Quat.html#a490a6eb0ebee1ced3b6e1d84a8e9d48d">inv</a> (<a class="el" href="../../d0/de1/group__core.html#ga935c8234953e2a2c8557c019ad8d509e">QuatAssumeType</a> assumeUnit=<a class="el" href="../../d0/de1/group__core.html#gga935c8234953e2a2c8557c019ad8d509ea786f758552bf7be9ee5f12ca2157cf8f">QUAT_ASSUME_NOT_UNIT</a>) const</td></tr>
<tr class="memdesc:a490a6eb0ebee1ced3b6e1d84a8e9d48d"><td class="mdescLeft">&#160;</td><td class="mdescRight">return \(q^{-1}\) which is an inverse of \(q\) satisfying \(q * q^{-1} = 1\).  <a href="#a490a6eb0ebee1ced3b6e1d84a8e9d48d">More...</a><br /></td></tr>
<tr class="separator:a490a6eb0ebee1ced3b6e1d84a8e9d48d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5c555f37ea9df65d7486ca234cc57c46"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../da/d4a/classcv_1_1Quat.html#a5c555f37ea9df65d7486ca234cc57c46">isNormal</a> (_Tp eps=<a class="el" href="../../da/d4a/classcv_1_1Quat.html#a10e3525ee098693c55b6ec47a9ac6c11">CV_QUAT_EPS</a>) const</td></tr>
<tr class="memdesc:a5c555f37ea9df65d7486ca234cc57c46"><td class="mdescLeft">&#160;</td><td class="mdescRight">return true if this quaternion is a unit quaternion.  <a href="#a5c555f37ea9df65d7486ca234cc57c46">More...</a><br /></td></tr>
<tr class="separator:a5c555f37ea9df65d7486ca234cc57c46"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a85994160793847a57d9c38d883493dec"><td class="memItemLeft" align="right" valign="top"><a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt; _Tp &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../da/d4a/classcv_1_1Quat.html#a85994160793847a57d9c38d883493dec">log</a> (<a class="el" href="../../d0/de1/group__core.html#ga935c8234953e2a2c8557c019ad8d509e">QuatAssumeType</a> assumeUnit=<a class="el" href="../../d0/de1/group__core.html#gga935c8234953e2a2c8557c019ad8d509ea786f758552bf7be9ee5f12ca2157cf8f">QUAT_ASSUME_NOT_UNIT</a>) const</td></tr>
<tr class="memdesc:a85994160793847a57d9c38d883493dec"><td class="mdescLeft">&#160;</td><td class="mdescRight">return the value of logarithm function. </p><p class="formulaDsp">
\[\ln(q) = \ln||q|| + \frac{\boldsymbol{v}}{||\boldsymbol{v}||}\arccos\frac{w}{||q||}\]
</p>
<p>. where \(\boldsymbol{v} = [x, y, z].\)  <a href="#a85994160793847a57d9c38d883493dec">More...</a><br /></td></tr>
<tr class="separator:a85994160793847a57d9c38d883493dec"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:abf08767595e119eee2f101420f7b9c24"><td class="memItemLeft" align="right" valign="top">_Tp&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../da/d4a/classcv_1_1Quat.html#abf08767595e119eee2f101420f7b9c24">norm</a> () const</td></tr>
<tr class="memdesc:abf08767595e119eee2f101420f7b9c24"><td class="mdescLeft">&#160;</td><td class="mdescRight">return the norm of quaternion. </p><p class="formulaDsp">
\[||q|| = \sqrt{w^2 + x^2 + y^2 + z^2}.\]
</p>
  <a href="#abf08767595e119eee2f101420f7b9c24">More...</a><br /></td></tr>
<tr class="separator:abf08767595e119eee2f101420f7b9c24"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a91f5fa95882bf5bfad5f9cb18297e085"><td class="memItemLeft" align="right" valign="top"><a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt; _Tp &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../da/d4a/classcv_1_1Quat.html#a91f5fa95882bf5bfad5f9cb18297e085">normalize</a> () const</td></tr>
<tr class="memdesc:a91f5fa95882bf5bfad5f9cb18297e085"><td class="mdescLeft">&#160;</td><td class="mdescRight">return a normalized \(p\). </p><p class="formulaDsp">
\[p = \frac{q}{||q||}\]
</p>
<p> where \(p\) satisfies \((p.x)^2 + (p.y)^2 + (p.z)^2 + (p.w)^2 = 1.\)  <a href="#a91f5fa95882bf5bfad5f9cb18297e085">More...</a><br /></td></tr>
<tr class="separator:a91f5fa95882bf5bfad5f9cb18297e085"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0837a42d59c5bbbf435beb5c4b1e52b3"><td class="memItemLeft" align="right" valign="top"><a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt; _Tp &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../da/d4a/classcv_1_1Quat.html#a0837a42d59c5bbbf435beb5c4b1e52b3">operator*</a> (const <a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt; _Tp &gt; &amp;) const</td></tr>
<tr class="memdesc:a0837a42d59c5bbbf435beb5c4b1e52b3"><td class="mdescLeft">&#160;</td><td class="mdescRight">Multiplication operator of two quaternions q and p. Multiplies values on either side of the operator.  <a href="#a0837a42d59c5bbbf435beb5c4b1e52b3">More...</a><br /></td></tr>
<tr class="separator:a0837a42d59c5bbbf435beb5c4b1e52b3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2ea6a27a6d5b211cae33be00a031c65e"><td class="memItemLeft" align="right" valign="top"><a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt; _Tp &gt; &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../da/d4a/classcv_1_1Quat.html#a2ea6a27a6d5b211cae33be00a031c65e">operator*=</a> (const <a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt; _Tp &gt; &amp;)</td></tr>
<tr class="memdesc:a2ea6a27a6d5b211cae33be00a031c65e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Multiplication assignment operator of two quaternions q and p. It multiplies right operand with the left operand and assign the result to left operand.  <a href="#a2ea6a27a6d5b211cae33be00a031c65e">More...</a><br /></td></tr>
<tr class="separator:a2ea6a27a6d5b211cae33be00a031c65e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a93f614ab00b038a6427a4137cc8982e7"><td class="memItemLeft" align="right" valign="top"><a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt; _Tp &gt; &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../da/d4a/classcv_1_1Quat.html#a93f614ab00b038a6427a4137cc8982e7">operator*=</a> (const _Tp s)</td></tr>
<tr class="memdesc:a93f614ab00b038a6427a4137cc8982e7"><td class="mdescLeft">&#160;</td><td class="mdescRight">Multiplication assignment operator of a quaternions and a scalar. It multiplies right operand with the left operand and assign the result to left operand.  <a href="#a93f614ab00b038a6427a4137cc8982e7">More...</a><br /></td></tr>
<tr class="separator:a93f614ab00b038a6427a4137cc8982e7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab32e1bf6a03279a78ef8752233e71686"><td class="memItemLeft" align="right" valign="top"><a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt; _Tp &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../da/d4a/classcv_1_1Quat.html#ab32e1bf6a03279a78ef8752233e71686">operator+</a> (const <a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt; _Tp &gt; &amp;) const</td></tr>
<tr class="memdesc:ab32e1bf6a03279a78ef8752233e71686"><td class="mdescLeft">&#160;</td><td class="mdescRight">Addition operator of two quaternions p and q. It returns a new quaternion that each value is the sum of \(p_i\) and \(q_i\).  <a href="#ab32e1bf6a03279a78ef8752233e71686">More...</a><br /></td></tr>
<tr class="separator:ab32e1bf6a03279a78ef8752233e71686"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a37f911ebb0a13e449a09c819c6bbaddb"><td class="memItemLeft" align="right" valign="top"><a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt; _Tp &gt; &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../da/d4a/classcv_1_1Quat.html#a37f911ebb0a13e449a09c819c6bbaddb">operator+=</a> (const <a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt; _Tp &gt; &amp;)</td></tr>
<tr class="memdesc:a37f911ebb0a13e449a09c819c6bbaddb"><td class="mdescLeft">&#160;</td><td class="mdescRight">Addition assignment operator of two quaternions p and q. It adds right operand to the left operand and assign the result to left operand.  <a href="#a37f911ebb0a13e449a09c819c6bbaddb">More...</a><br /></td></tr>
<tr class="separator:a37f911ebb0a13e449a09c819c6bbaddb"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a71348b2a7699dddb5108544eb17ab7db"><td class="memItemLeft" align="right" valign="top"><a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt; _Tp &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../da/d4a/classcv_1_1Quat.html#a71348b2a7699dddb5108544eb17ab7db">operator-</a> () const</td></tr>
<tr class="memdesc:a71348b2a7699dddb5108544eb17ab7db"><td class="mdescLeft">&#160;</td><td class="mdescRight">Return opposite quaternion \(-p\) which satisfies \(p + (-p) = 0.\).  <a href="#a71348b2a7699dddb5108544eb17ab7db">More...</a><br /></td></tr>
<tr class="separator:a71348b2a7699dddb5108544eb17ab7db"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:afe0f5e293bc012dba035c69827de71f9"><td class="memItemLeft" align="right" valign="top"><a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt; _Tp &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../da/d4a/classcv_1_1Quat.html#afe0f5e293bc012dba035c69827de71f9">operator-</a> (const <a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt; _Tp &gt; &amp;) const</td></tr>
<tr class="memdesc:afe0f5e293bc012dba035c69827de71f9"><td class="mdescLeft">&#160;</td><td class="mdescRight">Subtraction operator of two quaternions p and q. It returns a new quaternion that each value is the sum of \(p_i\) and \(-q_i\).  <a href="#afe0f5e293bc012dba035c69827de71f9">More...</a><br /></td></tr>
<tr class="separator:afe0f5e293bc012dba035c69827de71f9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac98891daea0b395e3fa3e4ecd8431d5a"><td class="memItemLeft" align="right" valign="top"><a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt; _Tp &gt; &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../da/d4a/classcv_1_1Quat.html#ac98891daea0b395e3fa3e4ecd8431d5a">operator-=</a> (const <a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt; _Tp &gt; &amp;)</td></tr>
<tr class="memdesc:ac98891daea0b395e3fa3e4ecd8431d5a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Subtraction assignment operator of two quaternions p and q. It subtracts right operand from the left operand and assign the result to left operand.  <a href="#ac98891daea0b395e3fa3e4ecd8431d5a">More...</a><br /></td></tr>
<tr class="separator:ac98891daea0b395e3fa3e4ecd8431d5a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab62225241515e49b7938f1fed16b17de"><td class="memItemLeft" align="right" valign="top"><a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt; _Tp &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../da/d4a/classcv_1_1Quat.html#ab62225241515e49b7938f1fed16b17de">operator/</a> (const _Tp s) const</td></tr>
<tr class="memdesc:ab62225241515e49b7938f1fed16b17de"><td class="mdescLeft">&#160;</td><td class="mdescRight">Division operator of a quaternions and a scalar. It divides left operand with the right operand and assign the result to left operand.  <a href="#ab62225241515e49b7938f1fed16b17de">More...</a><br /></td></tr>
<tr class="separator:ab62225241515e49b7938f1fed16b17de"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad670ebda552693adbfc512b80f24119e"><td class="memItemLeft" align="right" valign="top"><a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt; _Tp &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../da/d4a/classcv_1_1Quat.html#ad670ebda552693adbfc512b80f24119e">operator/</a> (const <a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt; _Tp &gt; &amp;) const</td></tr>
<tr class="memdesc:ad670ebda552693adbfc512b80f24119e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Division operator of two quaternions p and q. Divides left hand operand by right hand operand.  <a href="#ad670ebda552693adbfc512b80f24119e">More...</a><br /></td></tr>
<tr class="separator:ad670ebda552693adbfc512b80f24119e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab42ddebef690e0f8fec8b5196bd7af3d"><td class="memItemLeft" align="right" valign="top"><a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt; _Tp &gt; &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../da/d4a/classcv_1_1Quat.html#ab42ddebef690e0f8fec8b5196bd7af3d">operator/=</a> (const _Tp s)</td></tr>
<tr class="memdesc:ab42ddebef690e0f8fec8b5196bd7af3d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Division assignment operator of a quaternions and a scalar. It divides left operand with the right operand and assign the result to left operand.  <a href="#ab42ddebef690e0f8fec8b5196bd7af3d">More...</a><br /></td></tr>
<tr class="separator:ab42ddebef690e0f8fec8b5196bd7af3d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa3bd08f9e7ffcb2ee62ff92c24cf17df"><td class="memItemLeft" align="right" valign="top"><a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt; _Tp &gt; &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../da/d4a/classcv_1_1Quat.html#aa3bd08f9e7ffcb2ee62ff92c24cf17df">operator/=</a> (const <a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt; _Tp &gt; &amp;)</td></tr>
<tr class="memdesc:aa3bd08f9e7ffcb2ee62ff92c24cf17df"><td class="mdescLeft">&#160;</td><td class="mdescRight">Division assignment operator of two quaternions p and q; It divides left operand with the right operand and assign the result to left operand.  <a href="#aa3bd08f9e7ffcb2ee62ff92c24cf17df">More...</a><br /></td></tr>
<tr class="separator:aa3bd08f9e7ffcb2ee62ff92c24cf17df"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1ce2829104f53d64fc24c8b4510f69de"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../da/d4a/classcv_1_1Quat.html#a1ce2829104f53d64fc24c8b4510f69de">operator==</a> (const <a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt; _Tp &gt; &amp;) const</td></tr>
<tr class="memdesc:a1ce2829104f53d64fc24c8b4510f69de"><td class="mdescLeft">&#160;</td><td class="mdescRight">return true if two quaternions p and q are nearly equal, i.e. when the absolute value of each \(p_i\) and \(q_i\) is less than CV_QUAT_EPS.  <a href="#a1ce2829104f53d64fc24c8b4510f69de">More...</a><br /></td></tr>
<tr class="separator:a1ce2829104f53d64fc24c8b4510f69de"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a786d0ccdcfd4aedb8327a50746133d07"><td class="memItemLeft" align="right" valign="top">_Tp &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../da/d4a/classcv_1_1Quat.html#a786d0ccdcfd4aedb8327a50746133d07">operator[]</a> (std::size_t n)</td></tr>
<tr class="separator:a786d0ccdcfd4aedb8327a50746133d07"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:adb5d2a8c84e39398f05cf6d72a8fb50e"><td class="memItemLeft" align="right" valign="top">const _Tp &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../da/d4a/classcv_1_1Quat.html#adb5d2a8c84e39398f05cf6d72a8fb50e">operator[]</a> (std::size_t n) const</td></tr>
<tr class="separator:adb5d2a8c84e39398f05cf6d72a8fb50e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af16b8dfb0acf34fc917f05de288daa22"><td class="memItemLeft" align="right" valign="top"><a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt; _Tp &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../da/d4a/classcv_1_1Quat.html#af16b8dfb0acf34fc917f05de288daa22">power</a> (const _Tp <a class="el" href="../../da/d4a/classcv_1_1Quat.html#ab2fbcb463f79a6b9de87c440e3c09dc7">x</a>, <a class="el" href="../../d0/de1/group__core.html#ga935c8234953e2a2c8557c019ad8d509e">QuatAssumeType</a> assumeUnit=<a class="el" href="../../d0/de1/group__core.html#gga935c8234953e2a2c8557c019ad8d509ea786f758552bf7be9ee5f12ca2157cf8f">QUAT_ASSUME_NOT_UNIT</a>) const</td></tr>
<tr class="memdesc:af16b8dfb0acf34fc917f05de288daa22"><td class="mdescLeft">&#160;</td><td class="mdescRight">return the value of power function with index \(x\). </p><p class="formulaDsp">
\[q^x = ||q||(\cos(x\theta) + \boldsymbol{u}\sin(x\theta))).\]
</p>
  <a href="#af16b8dfb0acf34fc917f05de288daa22">More...</a><br /></td></tr>
<tr class="separator:af16b8dfb0acf34fc917f05de288daa22"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3026b0565b06af9ff97806032a746594"><td class="memItemLeft" align="right" valign="top"><a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt; _Tp &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../da/d4a/classcv_1_1Quat.html#a3026b0565b06af9ff97806032a746594">power</a> (const <a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt; _Tp &gt; &amp;q, <a class="el" href="../../d0/de1/group__core.html#ga935c8234953e2a2c8557c019ad8d509e">QuatAssumeType</a> assumeUnit=<a class="el" href="../../d0/de1/group__core.html#gga935c8234953e2a2c8557c019ad8d509ea786f758552bf7be9ee5f12ca2157cf8f">QUAT_ASSUME_NOT_UNIT</a>) const</td></tr>
<tr class="memdesc:a3026b0565b06af9ff97806032a746594"><td class="mdescLeft">&#160;</td><td class="mdescRight">return the value of power function with quaternion \(q\). </p><p class="formulaDsp">
\[p^q = e^{q\ln(p)}.\]
</p>
  <a href="#a3026b0565b06af9ff97806032a746594">More...</a><br /></td></tr>
<tr class="separator:a3026b0565b06af9ff97806032a746594"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a88d9b4b0497741ba741118fb9c626ed7"><td class="memItemLeft" align="right" valign="top"><a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt; _Tp &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../da/d4a/classcv_1_1Quat.html#a88d9b4b0497741ba741118fb9c626ed7">sin</a> () const</td></tr>
<tr class="memdesc:a88d9b4b0497741ba741118fb9c626ed7"><td class="mdescLeft">&#160;</td><td class="mdescRight">return sin value of this quaternion, sin could be calculated as: </p><p class="formulaDsp">
\[\sin(p) = \sin(w) * \cosh(||\boldsymbol{v}||) + \cos(w)\frac{\boldsymbol{v}}{||\boldsymbol{v}||}\sinh(||\boldsymbol{v}||)\]
</p>
<p> where \(\boldsymbol{v} = [x, y, z].\)  <a href="#a88d9b4b0497741ba741118fb9c626ed7">More...</a><br /></td></tr>
<tr class="separator:a88d9b4b0497741ba741118fb9c626ed7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a541f79fd2e9a99ac7cd39ebd499eca65"><td class="memItemLeft" align="right" valign="top"><a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt; _Tp &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../da/d4a/classcv_1_1Quat.html#a541f79fd2e9a99ac7cd39ebd499eca65">sinh</a> () const</td></tr>
<tr class="memdesc:a541f79fd2e9a99ac7cd39ebd499eca65"><td class="mdescLeft">&#160;</td><td class="mdescRight">return sinh value of this quaternion, sinh could be calculated as: \(\sinh(p) = \sin(w)\cos(||\boldsymbol{v}||) + \cosh(w)\frac{v}{||\boldsymbol{v}||}\sin||\boldsymbol{v}||\) where \(\boldsymbol{v} = [x, y, z].\)  <a href="#a541f79fd2e9a99ac7cd39ebd499eca65">More...</a><br /></td></tr>
<tr class="separator:a541f79fd2e9a99ac7cd39ebd499eca65"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aada8d353a0a9a610973768f25a8aeeed"><td class="memItemLeft" align="right" valign="top"><a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt; _Tp &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../da/d4a/classcv_1_1Quat.html#aada8d353a0a9a610973768f25a8aeeed">sqrt</a> (<a class="el" href="../../d0/de1/group__core.html#ga935c8234953e2a2c8557c019ad8d509e">QuatAssumeType</a> assumeUnit=<a class="el" href="../../d0/de1/group__core.html#gga935c8234953e2a2c8557c019ad8d509ea786f758552bf7be9ee5f12ca2157cf8f">QUAT_ASSUME_NOT_UNIT</a>) const</td></tr>
<tr class="memdesc:aada8d353a0a9a610973768f25a8aeeed"><td class="mdescLeft">&#160;</td><td class="mdescRight">return \(\sqrt{q}\).  <a href="#aada8d353a0a9a610973768f25a8aeeed">More...</a><br /></td></tr>
<tr class="separator:aada8d353a0a9a610973768f25a8aeeed"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ade63bd7caefaf41312013f6529b50902"><td class="memItemLeft" align="right" valign="top"><a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt; _Tp &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../da/d4a/classcv_1_1Quat.html#ade63bd7caefaf41312013f6529b50902">tan</a> () const</td></tr>
<tr class="memdesc:ade63bd7caefaf41312013f6529b50902"><td class="mdescLeft">&#160;</td><td class="mdescRight">return tan value of this quaternion, tan could be calculated as: </p><p class="formulaDsp">
\[\tan(q) = \frac{\sin(q)}{\cos(q)}.\]
</p>
  <a href="#ade63bd7caefaf41312013f6529b50902">More...</a><br /></td></tr>
<tr class="separator:ade63bd7caefaf41312013f6529b50902"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7f10eb9756915c30697c2536dc9107f8"><td class="memItemLeft" align="right" valign="top"><a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt; _Tp &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../da/d4a/classcv_1_1Quat.html#a7f10eb9756915c30697c2536dc9107f8">tanh</a> () const</td></tr>
<tr class="memdesc:a7f10eb9756915c30697c2536dc9107f8"><td class="mdescLeft">&#160;</td><td class="mdescRight">return tanh value of this quaternion, tanh could be calculated as: </p><p class="formulaDsp">
\[ \tanh(q) = \frac{\sinh(q)}{\cosh(q)}.\]
</p>
  <a href="#a7f10eb9756915c30697c2536dc9107f8">More...</a><br /></td></tr>
<tr class="separator:a7f10eb9756915c30697c2536dc9107f8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab492aa67bb7803caec230a12c612c4e6"><td class="memItemLeft" align="right" valign="top"><a class="el" href="../../d6/dcf/classcv_1_1Vec.html">Vec</a>&lt; _Tp, 3 &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../da/d4a/classcv_1_1Quat.html#ab492aa67bb7803caec230a12c612c4e6">toEulerAngles</a> (<a class="el" href="../../d2/d53/classcv_1_1QuatEnum.html#abceb161bc29a481f2f55439ec723ee45">QuatEnum::EulerAnglesType</a> eulerAnglesType)</td></tr>
<tr class="memdesc:ab492aa67bb7803caec230a12c612c4e6"><td class="mdescLeft">&#160;</td><td class="mdescRight">Transform a quaternion q to Euler angles.  <a href="#ab492aa67bb7803caec230a12c612c4e6">More...</a><br /></td></tr>
<tr class="separator:ab492aa67bb7803caec230a12c612c4e6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3d7acac76ca39522aaa3df9cd45ee1cf"><td class="memItemLeft" align="right" valign="top"><a class="el" href="../../de/de1/classcv_1_1Matx.html">Matx</a>&lt; _Tp, 3, 3 &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../da/d4a/classcv_1_1Quat.html#a3d7acac76ca39522aaa3df9cd45ee1cf">toRotMat3x3</a> (<a class="el" href="../../d0/de1/group__core.html#ga935c8234953e2a2c8557c019ad8d509e">QuatAssumeType</a> assumeUnit=<a class="el" href="../../d0/de1/group__core.html#gga935c8234953e2a2c8557c019ad8d509ea786f758552bf7be9ee5f12ca2157cf8f">QUAT_ASSUME_NOT_UNIT</a>) const</td></tr>
<tr class="memdesc:a3d7acac76ca39522aaa3df9cd45ee1cf"><td class="mdescLeft">&#160;</td><td class="mdescRight">transform a quaternion to a 3x3 rotation matrix.  <a href="#a3d7acac76ca39522aaa3df9cd45ee1cf">More...</a><br /></td></tr>
<tr class="separator:a3d7acac76ca39522aaa3df9cd45ee1cf"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8020a28df9d895b4d4263d827aa9eea2"><td class="memItemLeft" align="right" valign="top"><a class="el" href="../../de/de1/classcv_1_1Matx.html">Matx</a>&lt; _Tp, 4, 4 &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../da/d4a/classcv_1_1Quat.html#a8020a28df9d895b4d4263d827aa9eea2">toRotMat4x4</a> (<a class="el" href="../../d0/de1/group__core.html#ga935c8234953e2a2c8557c019ad8d509e">QuatAssumeType</a> assumeUnit=<a class="el" href="../../d0/de1/group__core.html#gga935c8234953e2a2c8557c019ad8d509ea786f758552bf7be9ee5f12ca2157cf8f">QUAT_ASSUME_NOT_UNIT</a>) const</td></tr>
<tr class="memdesc:a8020a28df9d895b4d4263d827aa9eea2"><td class="mdescLeft">&#160;</td><td class="mdescRight">transform a quaternion to a 4x4 rotation matrix.  <a href="#a8020a28df9d895b4d4263d827aa9eea2">More...</a><br /></td></tr>
<tr class="separator:a8020a28df9d895b4d4263d827aa9eea2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae4f521aba52df53f7484655dba8075de"><td class="memItemLeft" align="right" valign="top"><a class="el" href="../../d6/dcf/classcv_1_1Vec.html">Vec</a>&lt; _Tp, 3 &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../da/d4a/classcv_1_1Quat.html#ae4f521aba52df53f7484655dba8075de">toRotVec</a> (<a class="el" href="../../d0/de1/group__core.html#ga935c8234953e2a2c8557c019ad8d509e">QuatAssumeType</a> assumeUnit=<a class="el" href="../../d0/de1/group__core.html#gga935c8234953e2a2c8557c019ad8d509ea786f758552bf7be9ee5f12ca2157cf8f">QUAT_ASSUME_NOT_UNIT</a>) const</td></tr>
<tr class="memdesc:ae4f521aba52df53f7484655dba8075de"><td class="mdescLeft">&#160;</td><td class="mdescRight">transform this quaternion to a Rotation vector.  <a href="#ae4f521aba52df53f7484655dba8075de">More...</a><br /></td></tr>
<tr class="separator:ae4f521aba52df53f7484655dba8075de"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab22aeadc6a73208bb62570ccf631c02d"><td class="memItemLeft" align="right" valign="top"><a class="el" href="../../d6/dcf/classcv_1_1Vec.html">Vec</a>&lt; _Tp, 4 &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../da/d4a/classcv_1_1Quat.html#ab22aeadc6a73208bb62570ccf631c02d">toVec</a> () const</td></tr>
<tr class="memdesc:ab22aeadc6a73208bb62570ccf631c02d"><td class="mdescLeft">&#160;</td><td class="mdescRight">transform the this quaternion to a Vec&lt;T, 4&gt;.  <a href="#ab22aeadc6a73208bb62570ccf631c02d">More...</a><br /></td></tr>
<tr class="separator:ab22aeadc6a73208bb62570ccf631c02d"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-static-methods"></a>
Static Public Member Functions</h2></td></tr>
<tr class="memitem:ab9b2bcb68e895895e61c826223e1ab55"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt; _Tp &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../da/d4a/classcv_1_1Quat.html#ab9b2bcb68e895895e61c826223e1ab55">createFromAngleAxis</a> (const _Tp angle, const <a class="el" href="../../d6/dcf/classcv_1_1Vec.html">Vec</a>&lt; _Tp, 3 &gt; &amp;axis)</td></tr>
<tr class="memdesc:ab9b2bcb68e895895e61c826223e1ab55"><td class="mdescLeft">&#160;</td><td class="mdescRight">from an angle, axis. Axis will be normalized in this function. And it generates </p><p class="formulaDsp">
\[q = [\cos\psi, u_x\sin\psi,u_y\sin\psi, u_z\sin\psi].\]
</p>
<p> where \(\psi = \frac{\theta}{2}\), \(\theta\) is the rotation angle.  <a href="#ab9b2bcb68e895895e61c826223e1ab55">More...</a><br /></td></tr>
<tr class="separator:ab9b2bcb68e895895e61c826223e1ab55"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3b7e4952ad0eb8663533f3b408838597"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt; _Tp &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../da/d4a/classcv_1_1Quat.html#a3b7e4952ad0eb8663533f3b408838597">createFromEulerAngles</a> (const <a class="el" href="../../d6/dcf/classcv_1_1Vec.html">Vec</a>&lt; _Tp, 3 &gt; &amp;angles, <a class="el" href="../../d2/d53/classcv_1_1QuatEnum.html#abceb161bc29a481f2f55439ec723ee45">QuatEnum::EulerAnglesType</a> eulerAnglesType)</td></tr>
<tr class="memdesc:a3b7e4952ad0eb8663533f3b408838597"><td class="mdescLeft">&#160;</td><td class="mdescRight">from Euler angles  <a href="#a3b7e4952ad0eb8663533f3b408838597">More...</a><br /></td></tr>
<tr class="separator:a3b7e4952ad0eb8663533f3b408838597"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a52446abf008a34e85d9f66cd105cb0f6"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt; _Tp &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../da/d4a/classcv_1_1Quat.html#a52446abf008a34e85d9f66cd105cb0f6">createFromRotMat</a> (<a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> R)</td></tr>
<tr class="memdesc:a52446abf008a34e85d9f66cd105cb0f6"><td class="mdescLeft">&#160;</td><td class="mdescRight">from a 3x3 rotation matrix.  <a href="#a52446abf008a34e85d9f66cd105cb0f6">More...</a><br /></td></tr>
<tr class="separator:a52446abf008a34e85d9f66cd105cb0f6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae473706f7c8378b0948cf6036dbd0c2d"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt; _Tp &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../da/d4a/classcv_1_1Quat.html#ae473706f7c8378b0948cf6036dbd0c2d">createFromRvec</a> (<a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> rvec)</td></tr>
<tr class="memdesc:ae473706f7c8378b0948cf6036dbd0c2d"><td class="mdescLeft">&#160;</td><td class="mdescRight">from a rotation vector \(r\) has the form \(\theta \cdot \boldsymbol{u}\), where \(\theta\) represents rotation angle and \(\boldsymbol{u}\) represents normalized rotation axis.  <a href="#ae473706f7c8378b0948cf6036dbd0c2d">More...</a><br /></td></tr>
<tr class="separator:ae473706f7c8378b0948cf6036dbd0c2d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:afc0cafb971db6965a2d975f9546c9863"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt; _Tp &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../da/d4a/classcv_1_1Quat.html#afc0cafb971db6965a2d975f9546c9863">createFromXRot</a> (const _Tp theta)</td></tr>
<tr class="memdesc:afc0cafb971db6965a2d975f9546c9863"><td class="mdescLeft">&#160;</td><td class="mdescRight">get a quaternion from a rotation about the X-axis by \(\theta\) . </p><p class="formulaDsp">
\[q = \cos(\theta/2)+sin(\theta/2) i +0 j +0 k \]
</p>
  <a href="#afc0cafb971db6965a2d975f9546c9863">More...</a><br /></td></tr>
<tr class="separator:afc0cafb971db6965a2d975f9546c9863"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad993413035fa0b9fc7929ccb103d68db"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt; _Tp &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../da/d4a/classcv_1_1Quat.html#ad993413035fa0b9fc7929ccb103d68db">createFromYRot</a> (const _Tp theta)</td></tr>
<tr class="memdesc:ad993413035fa0b9fc7929ccb103d68db"><td class="mdescLeft">&#160;</td><td class="mdescRight">get a quaternion from a rotation about the Y-axis by \(\theta\) . </p><p class="formulaDsp">
\[q = \cos(\theta/2)+0 i+ sin(\theta/2) j +0k \]
</p>
  <a href="#ad993413035fa0b9fc7929ccb103d68db">More...</a><br /></td></tr>
<tr class="separator:ad993413035fa0b9fc7929ccb103d68db"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9169918a8b2b9467d69c3730d33738fc"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt; _Tp &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../da/d4a/classcv_1_1Quat.html#a9169918a8b2b9467d69c3730d33738fc">createFromZRot</a> (const _Tp theta)</td></tr>
<tr class="memdesc:a9169918a8b2b9467d69c3730d33738fc"><td class="mdescLeft">&#160;</td><td class="mdescRight">get a quaternion from a rotation about the Z-axis by \(\theta\). </p><p class="formulaDsp">
\[q = \cos(\theta/2)+0 i +0 j +sin(\theta/2) k \]
</p>
  <a href="#a9169918a8b2b9467d69c3730d33738fc">More...</a><br /></td></tr>
<tr class="separator:a9169918a8b2b9467d69c3730d33738fc"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8872c3d9bddaea12532e3181d32e21f2"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt; _Tp &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../da/d4a/classcv_1_1Quat.html#a8872c3d9bddaea12532e3181d32e21f2">interPoint</a> (const <a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt; _Tp &gt; &amp;q0, const <a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt; _Tp &gt; &amp;q1, const <a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt; _Tp &gt; &amp;q2, <a class="el" href="../../d0/de1/group__core.html#ga935c8234953e2a2c8557c019ad8d509e">QuatAssumeType</a> assumeUnit=<a class="el" href="../../d0/de1/group__core.html#gga935c8234953e2a2c8557c019ad8d509ea786f758552bf7be9ee5f12ca2157cf8f">QUAT_ASSUME_NOT_UNIT</a>)</td></tr>
<tr class="memdesc:a8872c3d9bddaea12532e3181d32e21f2"><td class="mdescLeft">&#160;</td><td class="mdescRight">This is the part calculation of squad. To calculate the intermedia quaternion \(s_i\) between each three quaternion </p><p class="formulaDsp">
\[s_i = q_i\exp(-\frac{\log(q^*_iq_{i+1}) + \log(q^*_iq_{i-1})}{4}).\]
</p>
<p>.  <a href="#a8872c3d9bddaea12532e3181d32e21f2">More...</a><br /></td></tr>
<tr class="separator:a8872c3d9bddaea12532e3181d32e21f2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0b24cb7b28c8f7dafd10efd64c8e339d"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt; _Tp &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../da/d4a/classcv_1_1Quat.html#a0b24cb7b28c8f7dafd10efd64c8e339d">lerp</a> (const <a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt; _Tp &gt; &amp;q0, const <a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a> &amp;q1, const _Tp t)</td></tr>
<tr class="memdesc:a0b24cb7b28c8f7dafd10efd64c8e339d"><td class="mdescLeft">&#160;</td><td class="mdescRight">To calculate the interpolation from \(q_0\) to \(q_1\) by Linear Interpolation(Nlerp) For two quaternions, this interpolation curve can be displayed as: </p><p class="formulaDsp">
\[Lerp(q_0, q_1, t) = (1 - t)q_0 + tq_1.\]
</p>
<p> Obviously, the lerp will interpolate along a straight line if we think of \(q_0\) and \(q_1\) as a vector in a two-dimensional space. When \(t = 0\), it returns \(q_0\) and when \(t= 1\), it returns \(q_1\). \(t\) should to be ranged in \([0, 1]\) normally.  <a href="#a0b24cb7b28c8f7dafd10efd64c8e339d">More...</a><br /></td></tr>
<tr class="separator:a0b24cb7b28c8f7dafd10efd64c8e339d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab718c0c09577eb599f77a1a9cf083eec"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt; _Tp &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../da/d4a/classcv_1_1Quat.html#ab718c0c09577eb599f77a1a9cf083eec">nlerp</a> (const <a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt; _Tp &gt; &amp;q0, const <a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a> &amp;q1, const _Tp t, <a class="el" href="../../d0/de1/group__core.html#ga935c8234953e2a2c8557c019ad8d509e">QuatAssumeType</a> assumeUnit=<a class="el" href="../../d0/de1/group__core.html#gga935c8234953e2a2c8557c019ad8d509ea786f758552bf7be9ee5f12ca2157cf8f">QUAT_ASSUME_NOT_UNIT</a>)</td></tr>
<tr class="memdesc:ab718c0c09577eb599f77a1a9cf083eec"><td class="mdescLeft">&#160;</td><td class="mdescRight">To calculate the interpolation from \(q_0\) to \(q_1\) by Normalized Linear Interpolation(Nlerp). it returns a normalized quaternion of Linear Interpolation(Lerp). </p><p class="formulaDsp">
\[ Nlerp(q_0, q_1, t) = \frac{(1 - t)q_0 + tq_1}{||(1 - t)q_0 + tq_1||}.\]
</p>
<p> The interpolation will always choose the shortest path but the constant speed is not guaranteed.  <a href="#ab718c0c09577eb599f77a1a9cf083eec">More...</a><br /></td></tr>
<tr class="separator:ab718c0c09577eb599f77a1a9cf083eec"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a576b87e4b1c1b9682694be796b97b23b"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt; _Tp &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../da/d4a/classcv_1_1Quat.html#a576b87e4b1c1b9682694be796b97b23b">slerp</a> (const <a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt; _Tp &gt; &amp;q0, const <a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a> &amp;q1, const _Tp t, <a class="el" href="../../d0/de1/group__core.html#ga935c8234953e2a2c8557c019ad8d509e">QuatAssumeType</a> assumeUnit=<a class="el" href="../../d0/de1/group__core.html#gga935c8234953e2a2c8557c019ad8d509ea786f758552bf7be9ee5f12ca2157cf8f">QUAT_ASSUME_NOT_UNIT</a>, bool directChange=true)</td></tr>
<tr class="memdesc:a576b87e4b1c1b9682694be796b97b23b"><td class="mdescLeft">&#160;</td><td class="mdescRight">To calculate the interpolation between \(q_0\) and \(q_1\) by Spherical Linear Interpolation(Slerp), which can be defined as: </p><p class="formulaDsp">
\[ Slerp(q_0, q_1, t) = \frac{\sin((1-t)\theta)}{\sin(\theta)}q_0 + \frac{\sin(t\theta)}{\sin(\theta)}q_1\]
</p>
<p> where \(\theta\) can be calculated as: </p><p class="formulaDsp">
\[\theta=cos^{-1}(q_0\cdot q_1)\]
</p>
<p> resulting from the both of their norm is unit.  <a href="#a576b87e4b1c1b9682694be796b97b23b">More...</a><br /></td></tr>
<tr class="separator:a576b87e4b1c1b9682694be796b97b23b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa9f545f7df73a8a1635ceda2a0464362"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt; _Tp &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../da/d4a/classcv_1_1Quat.html#aa9f545f7df73a8a1635ceda2a0464362">spline</a> (const <a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt; _Tp &gt; &amp;q0, const <a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt; _Tp &gt; &amp;q1, const <a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt; _Tp &gt; &amp;q2, const <a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt; _Tp &gt; &amp;q3, const _Tp t, <a class="el" href="../../d0/de1/group__core.html#ga935c8234953e2a2c8557c019ad8d509e">QuatAssumeType</a> assumeUnit=<a class="el" href="../../d0/de1/group__core.html#gga935c8234953e2a2c8557c019ad8d509ea786f758552bf7be9ee5f12ca2157cf8f">QUAT_ASSUME_NOT_UNIT</a>)</td></tr>
<tr class="memdesc:aa9f545f7df73a8a1635ceda2a0464362"><td class="mdescLeft">&#160;</td><td class="mdescRight">to calculate a quaternion which is the result of a \(C^1\) continuous spline curve constructed by squad at the ratio t. Here, the interpolation values are between \(q_1\) and \(q_2\). \(q_0\) and \(q_2\) are used to ensure the \(C^1\) continuity. if t = 0, it returns \(q_1\), if t = 1, it returns \(q_2\).  <a href="#aa9f545f7df73a8a1635ceda2a0464362">More...</a><br /></td></tr>
<tr class="separator:aa9f545f7df73a8a1635ceda2a0464362"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aeec581d46d161f89b8c19f396e491cf2"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt; _Tp &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../da/d4a/classcv_1_1Quat.html#aeec581d46d161f89b8c19f396e491cf2">squad</a> (const <a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt; _Tp &gt; &amp;q0, const <a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt; _Tp &gt; &amp;s0, const <a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt; _Tp &gt; &amp;s1, const <a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt; _Tp &gt; &amp;q1, const _Tp t, <a class="el" href="../../d0/de1/group__core.html#ga935c8234953e2a2c8557c019ad8d509e">QuatAssumeType</a> assumeUnit=<a class="el" href="../../d0/de1/group__core.html#gga935c8234953e2a2c8557c019ad8d509ea786f758552bf7be9ee5f12ca2157cf8f">QUAT_ASSUME_NOT_UNIT</a>, bool directChange=true)</td></tr>
<tr class="memdesc:aeec581d46d161f89b8c19f396e491cf2"><td class="mdescLeft">&#160;</td><td class="mdescRight">To calculate the interpolation between \(q_0\), \(q_1\), \(q_2\), \(q_3\) by Spherical and quadrangle(Squad). This could be defined as: </p><p class="formulaDsp">
\[Squad(q_i, s_i, s_{i+1}, q_{i+1}, t) = Slerp(Slerp(q_i, q_{i+1}, t), Slerp(s_i, s_{i+1}, t), 2t(1-t))\]
</p>
<p> where </p><p class="formulaDsp">
\[s_i = q_i\exp(-\frac{\log(q^*_iq_{i+1}) + \log(q^*_iq_{i-1})}{4})\]
</p>
<p>.  <a href="#aeec581d46d161f89b8c19f396e491cf2">More...</a><br /></td></tr>
<tr class="separator:aeec581d46d161f89b8c19f396e491cf2"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-attribs"></a>
Public Attributes</h2></td></tr>
<tr class="memitem:af261492a691c1f0ae62708564b2f1021"><td class="memItemLeft" align="right" valign="top">_Tp&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../da/d4a/classcv_1_1Quat.html#af261492a691c1f0ae62708564b2f1021">w</a></td></tr>
<tr class="separator:af261492a691c1f0ae62708564b2f1021"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab2fbcb463f79a6b9de87c440e3c09dc7"><td class="memItemLeft" align="right" valign="top">_Tp&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../da/d4a/classcv_1_1Quat.html#ab2fbcb463f79a6b9de87c440e3c09dc7">x</a></td></tr>
<tr class="separator:ab2fbcb463f79a6b9de87c440e3c09dc7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7fec2f7d0b5928826dd359773643ecdc"><td class="memItemLeft" align="right" valign="top">_Tp&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../da/d4a/classcv_1_1Quat.html#a7fec2f7d0b5928826dd359773643ecdc">y</a></td></tr>
<tr class="separator:a7fec2f7d0b5928826dd359773643ecdc"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6836f50dd74292ad753a51a906200af2"><td class="memItemLeft" align="right" valign="top">_Tp&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../da/d4a/classcv_1_1Quat.html#a6836f50dd74292ad753a51a906200af2">z</a></td></tr>
<tr class="separator:a6836f50dd74292ad753a51a906200af2"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-static-attribs"></a>
Static Public Attributes</h2></td></tr>
<tr class="memitem:ad8f52c20247c809ca07935f41edce618"><td class="memItemLeft" align="right" valign="top">static constexpr _Tp&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../da/d4a/classcv_1_1Quat.html#ad8f52c20247c809ca07935f41edce618">CV_QUAT_CONVERT_THRESHOLD</a> = (_Tp)1.e-6</td></tr>
<tr class="separator:ad8f52c20247c809ca07935f41edce618"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a10e3525ee098693c55b6ec47a9ac6c11"><td class="memItemLeft" align="right" valign="top">static constexpr _Tp&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../da/d4a/classcv_1_1Quat.html#a10e3525ee098693c55b6ec47a9ac6c11">CV_QUAT_EPS</a> = (_Tp)1.e-6</td></tr>
<tr class="separator:a10e3525ee098693c55b6ec47a9ac6c11"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="friends"></a>
Friends</h2></td></tr>
<tr class="memitem:afdcc13d7f08a0375079d5f2ca32ead73"><td class="memTemplParams" colspan="2">template&lt;typename T &gt; </td></tr>
<tr class="memitem:afdcc13d7f08a0375079d5f2ca32ead73"><td class="memTemplItemLeft" align="right" valign="top"><a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt; T &gt;&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="../../da/d4a/classcv_1_1Quat.html#afdcc13d7f08a0375079d5f2ca32ead73">acos</a> (const <a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt; T &gt; &amp;q)</td></tr>
<tr class="memdesc:afdcc13d7f08a0375079d5f2ca32ead73"><td class="mdescLeft">&#160;</td><td class="mdescRight">return arccos value of quaternion q, arccos could be calculated as: </p><p class="formulaDsp">
\[\arccos(q) = -\frac{\boldsymbol{v}}{||\boldsymbol{v}||}arccosh(q)\]
</p>
<p> where \(\boldsymbol{v} = [x, y, z].\)  <a href="#afdcc13d7f08a0375079d5f2ca32ead73">More...</a><br /></td></tr>
<tr class="separator:afdcc13d7f08a0375079d5f2ca32ead73"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2ed2761540634dd41c532b7c75f2d8e6"><td class="memTemplParams" colspan="2">template&lt;typename T &gt; </td></tr>
<tr class="memitem:a2ed2761540634dd41c532b7c75f2d8e6"><td class="memTemplItemLeft" align="right" valign="top"><a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt; T &gt;&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="../../da/d4a/classcv_1_1Quat.html#a2ed2761540634dd41c532b7c75f2d8e6">acosh</a> (const <a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt; T &gt; &amp;q)</td></tr>
<tr class="memdesc:a2ed2761540634dd41c532b7c75f2d8e6"><td class="mdescLeft">&#160;</td><td class="mdescRight">return arccosh value of quaternion q, arccosh could be calculated as: </p><p class="formulaDsp">
\[arccosh(q) = \ln(q + \sqrt{q^2 - 1})\]
</p>
<p>.  <a href="#a2ed2761540634dd41c532b7c75f2d8e6">More...</a><br /></td></tr>
<tr class="separator:a2ed2761540634dd41c532b7c75f2d8e6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a78176c2913c20f7e99c00c781a98f699"><td class="memTemplParams" colspan="2">template&lt;typename T &gt; </td></tr>
<tr class="memitem:a78176c2913c20f7e99c00c781a98f699"><td class="memTemplItemLeft" align="right" valign="top"><a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt; T &gt;&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="../../da/d4a/classcv_1_1Quat.html#a78176c2913c20f7e99c00c781a98f699">asin</a> (const <a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt; T &gt; &amp;q)</td></tr>
<tr class="memdesc:a78176c2913c20f7e99c00c781a98f699"><td class="mdescLeft">&#160;</td><td class="mdescRight">return arcsin value of quaternion q, arcsin could be calculated as: </p><p class="formulaDsp">
\[\arcsin(q) = -\frac{\boldsymbol{v}}{||\boldsymbol{v}||}arcsinh(q\frac{\boldsymbol{v}}{||\boldsymbol{v}||})\]
</p>
<p> where \(\boldsymbol{v} = [x, y, z].\)  <a href="#a78176c2913c20f7e99c00c781a98f699">More...</a><br /></td></tr>
<tr class="separator:a78176c2913c20f7e99c00c781a98f699"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a018058ca2be87fe61f8b26a594c99927"><td class="memTemplParams" colspan="2">template&lt;typename T &gt; </td></tr>
<tr class="memitem:a018058ca2be87fe61f8b26a594c99927"><td class="memTemplItemLeft" align="right" valign="top"><a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt; T &gt;&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="../../da/d4a/classcv_1_1Quat.html#a018058ca2be87fe61f8b26a594c99927">asinh</a> (const <a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt; T &gt; &amp;q)</td></tr>
<tr class="memdesc:a018058ca2be87fe61f8b26a594c99927"><td class="mdescLeft">&#160;</td><td class="mdescRight">return arcsinh value of quaternion q, arcsinh could be calculated as: </p><p class="formulaDsp">
\[arcsinh(q) = \ln(q + \sqrt{q^2 + 1})\]
</p>
<p>.  <a href="#a018058ca2be87fe61f8b26a594c99927">More...</a><br /></td></tr>
<tr class="separator:a018058ca2be87fe61f8b26a594c99927"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a17635e02afde2c6883444f2e40322535"><td class="memTemplParams" colspan="2">template&lt;typename T &gt; </td></tr>
<tr class="memitem:a17635e02afde2c6883444f2e40322535"><td class="memTemplItemLeft" align="right" valign="top"><a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt; T &gt;&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="../../da/d4a/classcv_1_1Quat.html#a17635e02afde2c6883444f2e40322535">atan</a> (const <a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt; T &gt; &amp;q)</td></tr>
<tr class="memdesc:a17635e02afde2c6883444f2e40322535"><td class="mdescLeft">&#160;</td><td class="mdescRight">return arctan value of quaternion q, arctan could be calculated as: </p><p class="formulaDsp">
\[\arctan(q) = -\frac{\boldsymbol{v}}{||\boldsymbol{v}||}arctanh(q\frac{\boldsymbol{v}}{||\boldsymbol{v}||})\]
</p>
<p> where \(\boldsymbol{v} = [x, y, z].\)  <a href="#a17635e02afde2c6883444f2e40322535">More...</a><br /></td></tr>
<tr class="separator:a17635e02afde2c6883444f2e40322535"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af2f8b47671a49d7d745edb95e6199b4a"><td class="memTemplParams" colspan="2">template&lt;typename T &gt; </td></tr>
<tr class="memitem:af2f8b47671a49d7d745edb95e6199b4a"><td class="memTemplItemLeft" align="right" valign="top"><a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt; T &gt;&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="../../da/d4a/classcv_1_1Quat.html#af2f8b47671a49d7d745edb95e6199b4a">atanh</a> (const <a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt; T &gt; &amp;q)</td></tr>
<tr class="memdesc:af2f8b47671a49d7d745edb95e6199b4a"><td class="mdescLeft">&#160;</td><td class="mdescRight">return arctanh value of quaternion q, arctanh could be calculated as: </p><p class="formulaDsp">
\[arctanh(q) = \frac{\ln(q + 1) - \ln(1 - q)}{2}\]
</p>
<p>.  <a href="#af2f8b47671a49d7d745edb95e6199b4a">More...</a><br /></td></tr>
<tr class="separator:af2f8b47671a49d7d745edb95e6199b4a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a556bb2fc6694c529a6d749b91da5d024"><td class="memTemplParams" colspan="2">template&lt;typename T &gt; </td></tr>
<tr class="memitem:a556bb2fc6694c529a6d749b91da5d024"><td class="memTemplItemLeft" align="right" valign="top"><a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt; T &gt;&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="../../da/d4a/classcv_1_1Quat.html#a556bb2fc6694c529a6d749b91da5d024">cos</a> (const <a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt; T &gt; &amp;q)</td></tr>
<tr class="memdesc:a556bb2fc6694c529a6d749b91da5d024"><td class="mdescLeft">&#160;</td><td class="mdescRight">return sin value of quaternion q, cos could be calculated as: </p><p class="formulaDsp">
\[\cos(p) = \cos(w) * \cosh(||\boldsymbol{v}||) - \sin(w)\frac{\boldsymbol{v}}{||\boldsymbol{v}||}\sinh(||\boldsymbol{v}||)\]
</p>
<p> where \(\boldsymbol{v} = [x, y, z].\)  <a href="#a556bb2fc6694c529a6d749b91da5d024">More...</a><br /></td></tr>
<tr class="separator:a556bb2fc6694c529a6d749b91da5d024"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8055944f530299760c54693f172050b4"><td class="memTemplParams" colspan="2">template&lt;typename T &gt; </td></tr>
<tr class="memitem:a8055944f530299760c54693f172050b4"><td class="memTemplItemLeft" align="right" valign="top"><a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt; T &gt;&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="../../da/d4a/classcv_1_1Quat.html#a8055944f530299760c54693f172050b4">cosh</a> (const <a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt; T &gt; &amp;q)</td></tr>
<tr class="memdesc:a8055944f530299760c54693f172050b4"><td class="mdescLeft">&#160;</td><td class="mdescRight">return cosh value of quaternion q, cosh could be calculated as: </p><p class="formulaDsp">
\[\cosh(p) = \cosh(w) * \cos(||\boldsymbol{v}||) + \sinh(w)\frac{\boldsymbol{v}}{||\boldsymbol{v}||}\sin(||\boldsymbol{v}||)\]
</p>
<p> where \(\boldsymbol{v} = [x, y, z].\)  <a href="#a8055944f530299760c54693f172050b4">More...</a><br /></td></tr>
<tr class="separator:a8055944f530299760c54693f172050b4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0d5d34fca2651a3c443d10a7d3afcee1"><td class="memTemplParams" colspan="2">template&lt;typename T &gt; </td></tr>
<tr class="memitem:a0d5d34fca2651a3c443d10a7d3afcee1"><td class="memTemplItemLeft" align="right" valign="top"><a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt; T &gt;&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="../../da/d4a/classcv_1_1Quat.html#a0d5d34fca2651a3c443d10a7d3afcee1">crossProduct</a> (const <a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt; T &gt; &amp;p, const <a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt; T &gt; &amp;q)</td></tr>
<tr class="memdesc:a0d5d34fca2651a3c443d10a7d3afcee1"><td class="mdescLeft">&#160;</td><td class="mdescRight">return the crossProduct between \(p = (a, b, c, d) = (a, \boldsymbol{u})\) and \(q = (w, x, y, z) = (w, \boldsymbol{v})\). </p><p class="formulaDsp">
\[p \times q = \frac{pq- qp}{2}\]
</p>
 <p class="formulaDsp">
\[p \times q = \boldsymbol{u} \times \boldsymbol{v}\]
</p>
 <p class="formulaDsp">
\[p \times q = (cz-dy)i + (dx-bz)j + (by-xc)k \]
</p>
  <a href="#a0d5d34fca2651a3c443d10a7d3afcee1">More...</a><br /></td></tr>
<tr class="separator:a0d5d34fca2651a3c443d10a7d3afcee1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:adb8e5d622ca910b60820ecefdc42fe5f"><td class="memTemplParams" colspan="2">template&lt;typename T &gt; </td></tr>
<tr class="memitem:adb8e5d622ca910b60820ecefdc42fe5f"><td class="memTemplItemLeft" align="right" valign="top"><a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt; T &gt;&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="../../da/d4a/classcv_1_1Quat.html#adb8e5d622ca910b60820ecefdc42fe5f">cv::operator*</a> (const T s, const <a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt; T &gt; &amp;)</td></tr>
<tr class="memdesc:adb8e5d622ca910b60820ecefdc42fe5f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Multiplication operator of a scalar and a quaternions. It multiplies right operand with the left operand and assign the result to left operand.  <a href="#adb8e5d622ca910b60820ecefdc42fe5f">More...</a><br /></td></tr>
<tr class="separator:adb8e5d622ca910b60820ecefdc42fe5f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2d45057d85114709c2e87881119c770c"><td class="memTemplParams" colspan="2">template&lt;typename T &gt; </td></tr>
<tr class="memitem:a2d45057d85114709c2e87881119c770c"><td class="memTemplItemLeft" align="right" valign="top"><a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt; T &gt;&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="../../da/d4a/classcv_1_1Quat.html#a2d45057d85114709c2e87881119c770c">cv::operator*</a> (const <a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt; T &gt; &amp;, const T s)</td></tr>
<tr class="memdesc:a2d45057d85114709c2e87881119c770c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Multiplication operator of a quaternion and a scalar. It multiplies right operand with the left operand and assign the result to left operand.  <a href="#a2d45057d85114709c2e87881119c770c">More...</a><br /></td></tr>
<tr class="separator:a2d45057d85114709c2e87881119c770c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac7dbced91b124a20abd408d4f4c4e599"><td class="memTemplParams" colspan="2">template&lt;typename T &gt; </td></tr>
<tr class="memitem:ac7dbced91b124a20abd408d4f4c4e599"><td class="memTemplItemLeft" align="right" valign="top"><a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt; T &gt;&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="../../da/d4a/classcv_1_1Quat.html#ac7dbced91b124a20abd408d4f4c4e599">cv::operator+</a> (const T s, const <a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt; T &gt; &amp;)</td></tr>
<tr class="memdesc:ac7dbced91b124a20abd408d4f4c4e599"><td class="mdescLeft">&#160;</td><td class="mdescRight">Addition operator of a quaternions and a scalar. Adds right hand operand from left hand operand.  <a href="#ac7dbced91b124a20abd408d4f4c4e599">More...</a><br /></td></tr>
<tr class="separator:ac7dbced91b124a20abd408d4f4c4e599"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a63135c782c2911cce4b7a71749c913ec"><td class="memTemplParams" colspan="2">template&lt;typename T &gt; </td></tr>
<tr class="memitem:a63135c782c2911cce4b7a71749c913ec"><td class="memTemplItemLeft" align="right" valign="top"><a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt; T &gt;&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="../../da/d4a/classcv_1_1Quat.html#a63135c782c2911cce4b7a71749c913ec">cv::operator+</a> (const <a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt; T &gt; &amp;, const T s)</td></tr>
<tr class="memdesc:a63135c782c2911cce4b7a71749c913ec"><td class="mdescLeft">&#160;</td><td class="mdescRight">Addition operator of a quaternions and a scalar. Adds right hand operand from left hand operand.  <a href="#a63135c782c2911cce4b7a71749c913ec">More...</a><br /></td></tr>
<tr class="separator:a63135c782c2911cce4b7a71749c913ec"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab8a8810efeacf0f99844831194c0692c"><td class="memTemplParams" colspan="2">template&lt;typename T &gt; </td></tr>
<tr class="memitem:ab8a8810efeacf0f99844831194c0692c"><td class="memTemplItemLeft" align="right" valign="top"><a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt; T &gt;&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="../../da/d4a/classcv_1_1Quat.html#ab8a8810efeacf0f99844831194c0692c">cv::operator-</a> (const T s, const <a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt; T &gt; &amp;)</td></tr>
<tr class="memdesc:ab8a8810efeacf0f99844831194c0692c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Subtraction operator of a scalar and a quaternions. Subtracts right hand operand from left hand operand.  <a href="#ab8a8810efeacf0f99844831194c0692c">More...</a><br /></td></tr>
<tr class="separator:ab8a8810efeacf0f99844831194c0692c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8e34d79198147bf83c61d0aebed4d46c"><td class="memTemplParams" colspan="2">template&lt;typename T &gt; </td></tr>
<tr class="memitem:a8e34d79198147bf83c61d0aebed4d46c"><td class="memTemplItemLeft" align="right" valign="top"><a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt; T &gt;&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="../../da/d4a/classcv_1_1Quat.html#a8e34d79198147bf83c61d0aebed4d46c">cv::operator-</a> (const <a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt; T &gt; &amp;, const T s)</td></tr>
<tr class="memdesc:a8e34d79198147bf83c61d0aebed4d46c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Subtraction operator of a quaternions and a scalar. Subtracts right hand operand from left hand operand.  <a href="#a8e34d79198147bf83c61d0aebed4d46c">More...</a><br /></td></tr>
<tr class="separator:a8e34d79198147bf83c61d0aebed4d46c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2de95d4627012f18f144e427e33dba35"><td class="memTemplParams" colspan="2">template&lt;typename S &gt; </td></tr>
<tr class="memitem:a2de95d4627012f18f144e427e33dba35"><td class="memTemplItemLeft" align="right" valign="top">std::ostream &amp;&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="../../da/d4a/classcv_1_1Quat.html#a2de95d4627012f18f144e427e33dba35">cv::operator&lt;&lt;</a> (std::ostream &amp;, const <a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt; S &gt; &amp;)</td></tr>
<tr class="separator:a2de95d4627012f18f144e427e33dba35"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a92e30501fcb79c29c8877709b55d612d"><td class="memTemplParams" colspan="2">template&lt;typename T &gt; </td></tr>
<tr class="memitem:a92e30501fcb79c29c8877709b55d612d"><td class="memTemplItemLeft" align="right" valign="top"><a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt; T &gt;&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="../../da/d4a/classcv_1_1Quat.html#a92e30501fcb79c29c8877709b55d612d">exp</a> (const <a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt; T &gt; &amp;q)</td></tr>
<tr class="memdesc:a92e30501fcb79c29c8877709b55d612d"><td class="mdescLeft">&#160;</td><td class="mdescRight">return the value of exponential value. </p><p class="formulaDsp">
\[\exp(q) = e^w (\cos||\boldsymbol{v}||+ \frac{v}{||\boldsymbol{v}||})\sin||\boldsymbol{v}||\]
</p>
<p> where \(\boldsymbol{v} = [x, y, z].\)  <a href="#a92e30501fcb79c29c8877709b55d612d">More...</a><br /></td></tr>
<tr class="separator:a92e30501fcb79c29c8877709b55d612d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab25ed7498bc5db29de2db5b5378f981c"><td class="memTemplParams" colspan="2">template&lt;typename T &gt; </td></tr>
<tr class="memitem:ab25ed7498bc5db29de2db5b5378f981c"><td class="memTemplItemLeft" align="right" valign="top"><a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt; T &gt;&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="../../da/d4a/classcv_1_1Quat.html#ab25ed7498bc5db29de2db5b5378f981c">inv</a> (const <a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt; T &gt; &amp;q, <a class="el" href="../../d0/de1/group__core.html#ga935c8234953e2a2c8557c019ad8d509e">QuatAssumeType</a> assumeUnit)</td></tr>
<tr class="memdesc:ab25ed7498bc5db29de2db5b5378f981c"><td class="mdescLeft">&#160;</td><td class="mdescRight">return \(q^{-1}\) which is an inverse of \(q\) which satisfies \(q * q^{-1} = 1\).  <a href="#ab25ed7498bc5db29de2db5b5378f981c">More...</a><br /></td></tr>
<tr class="separator:ab25ed7498bc5db29de2db5b5378f981c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:abcbac5d77bec374fe764832f519af1c3"><td class="memTemplParams" colspan="2">template&lt;typename T &gt; </td></tr>
<tr class="memitem:abcbac5d77bec374fe764832f519af1c3"><td class="memTemplItemLeft" align="right" valign="top"><a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt; T &gt;&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="../../da/d4a/classcv_1_1Quat.html#abcbac5d77bec374fe764832f519af1c3">log</a> (const <a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt; T &gt; &amp;q, <a class="el" href="../../d0/de1/group__core.html#ga935c8234953e2a2c8557c019ad8d509e">QuatAssumeType</a> assumeUnit)</td></tr>
<tr class="memdesc:abcbac5d77bec374fe764832f519af1c3"><td class="mdescLeft">&#160;</td><td class="mdescRight">return the value of logarithm function. </p><p class="formulaDsp">
\[\ln(q) = \ln||q|| + \frac{\boldsymbol{v}}{||\boldsymbol{v}||}\arccos\frac{w}{||q||}.\]
</p>
<p> where \(\boldsymbol{v} = [x, y, z].\)  <a href="#abcbac5d77bec374fe764832f519af1c3">More...</a><br /></td></tr>
<tr class="separator:abcbac5d77bec374fe764832f519af1c3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:abf9dce8edb81bdce0d8c577b47a920d9"><td class="memTemplParams" colspan="2">template&lt;typename T &gt; </td></tr>
<tr class="memitem:abf9dce8edb81bdce0d8c577b47a920d9"><td class="memTemplItemLeft" align="right" valign="top"><a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt; T &gt;&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="../../da/d4a/classcv_1_1Quat.html#abf9dce8edb81bdce0d8c577b47a920d9">power</a> (const <a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt; T &gt; &amp;q, const T <a class="el" href="../../da/d4a/classcv_1_1Quat.html#ab2fbcb463f79a6b9de87c440e3c09dc7">x</a>, <a class="el" href="../../d0/de1/group__core.html#ga935c8234953e2a2c8557c019ad8d509e">QuatAssumeType</a> assumeUnit)</td></tr>
<tr class="memdesc:abf9dce8edb81bdce0d8c577b47a920d9"><td class="mdescLeft">&#160;</td><td class="mdescRight">return the value of power function with index \(x\). </p><p class="formulaDsp">
\[q^x = ||q||(cos(x\theta) + \boldsymbol{u}sin(x\theta))).\]
</p>
  <a href="#abf9dce8edb81bdce0d8c577b47a920d9">More...</a><br /></td></tr>
<tr class="separator:abf9dce8edb81bdce0d8c577b47a920d9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aadec3e8895a41e97999d3d914064b3a7"><td class="memTemplParams" colspan="2">template&lt;typename T &gt; </td></tr>
<tr class="memitem:aadec3e8895a41e97999d3d914064b3a7"><td class="memTemplItemLeft" align="right" valign="top"><a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt; T &gt;&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="../../da/d4a/classcv_1_1Quat.html#aadec3e8895a41e97999d3d914064b3a7">power</a> (const <a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt; T &gt; &amp;p, const <a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt; T &gt; &amp;q, <a class="el" href="../../d0/de1/group__core.html#ga935c8234953e2a2c8557c019ad8d509e">QuatAssumeType</a> assumeUnit)</td></tr>
<tr class="memdesc:aadec3e8895a41e97999d3d914064b3a7"><td class="mdescLeft">&#160;</td><td class="mdescRight">return the value of power function with quaternion \(q\). </p><p class="formulaDsp">
\[p^q = e^{q\ln(p)}.\]
</p>
  <a href="#aadec3e8895a41e97999d3d914064b3a7">More...</a><br /></td></tr>
<tr class="separator:aadec3e8895a41e97999d3d914064b3a7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5391c041a71697dea04a1532a29494d9"><td class="memTemplParams" colspan="2">template&lt;typename T &gt; </td></tr>
<tr class="memitem:a5391c041a71697dea04a1532a29494d9"><td class="memTemplItemLeft" align="right" valign="top"><a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt; T &gt;&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="../../da/d4a/classcv_1_1Quat.html#a5391c041a71697dea04a1532a29494d9">sin</a> (const <a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt; T &gt; &amp;q)</td></tr>
<tr class="memdesc:a5391c041a71697dea04a1532a29494d9"><td class="mdescLeft">&#160;</td><td class="mdescRight">return tanh value of quaternion q, sin could be calculated as: </p><p class="formulaDsp">
\[\sin(p) = \sin(w) * \cosh(||\boldsymbol{v}||) + \cos(w)\frac{\boldsymbol{v}}{||\boldsymbol{v}||}\sinh(||\boldsymbol{v}||)\]
</p>
<p> where \(\boldsymbol{v} = [x, y, z].\)  <a href="#a5391c041a71697dea04a1532a29494d9">More...</a><br /></td></tr>
<tr class="separator:a5391c041a71697dea04a1532a29494d9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a10fa75e217469cba4bac9c7f743e3031"><td class="memTemplParams" colspan="2">template&lt;typename T &gt; </td></tr>
<tr class="memitem:a10fa75e217469cba4bac9c7f743e3031"><td class="memTemplItemLeft" align="right" valign="top"><a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt; T &gt;&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="../../da/d4a/classcv_1_1Quat.html#a10fa75e217469cba4bac9c7f743e3031">sinh</a> (const <a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt; T &gt; &amp;q)</td></tr>
<tr class="memdesc:a10fa75e217469cba4bac9c7f743e3031"><td class="mdescLeft">&#160;</td><td class="mdescRight">return sinh value of quaternion q, sinh could be calculated as: </p><p class="formulaDsp">
\[\sinh(p) = \sin(w)\cos(||\boldsymbol{v}||) + \cosh(w)\frac{v}{||\boldsymbol{v}||}\sin||\boldsymbol{v}||\]
</p>
<p> where \(\boldsymbol{v} = [x, y, z].\)  <a href="#a10fa75e217469cba4bac9c7f743e3031">More...</a><br /></td></tr>
<tr class="separator:a10fa75e217469cba4bac9c7f743e3031"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9c0ae34d84de01762207d330c98d3618"><td class="memTemplParams" colspan="2">template&lt;typename T &gt; </td></tr>
<tr class="memitem:a9c0ae34d84de01762207d330c98d3618"><td class="memTemplItemLeft" align="right" valign="top"><a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt; T &gt;&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="../../da/d4a/classcv_1_1Quat.html#a9c0ae34d84de01762207d330c98d3618">sqrt</a> (const <a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt; T &gt; &amp;q, <a class="el" href="../../d0/de1/group__core.html#ga935c8234953e2a2c8557c019ad8d509e">QuatAssumeType</a> assumeUnit)</td></tr>
<tr class="memdesc:a9c0ae34d84de01762207d330c98d3618"><td class="mdescLeft">&#160;</td><td class="mdescRight">return \(\sqrt{q}\).  <a href="#a9c0ae34d84de01762207d330c98d3618">More...</a><br /></td></tr>
<tr class="separator:a9c0ae34d84de01762207d330c98d3618"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab76e4322ad61dfb44dfc78a09d8c5c7e"><td class="memTemplParams" colspan="2">template&lt;typename T &gt; </td></tr>
<tr class="memitem:ab76e4322ad61dfb44dfc78a09d8c5c7e"><td class="memTemplItemLeft" align="right" valign="top"><a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt; T &gt;&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="../../da/d4a/classcv_1_1Quat.html#ab76e4322ad61dfb44dfc78a09d8c5c7e">tan</a> (const <a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt; T &gt; &amp;q)</td></tr>
<tr class="memdesc:ab76e4322ad61dfb44dfc78a09d8c5c7e"><td class="mdescLeft">&#160;</td><td class="mdescRight">return tan value of quaternion q, tan could be calculated as: </p><p class="formulaDsp">
\[\tan(q) = \frac{\sin(q)}{\cos(q)}.\]
</p>
  <a href="#ab76e4322ad61dfb44dfc78a09d8c5c7e">More...</a><br /></td></tr>
<tr class="separator:ab76e4322ad61dfb44dfc78a09d8c5c7e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:adfb2cae03ff36e40255d24195d9dad0d"><td class="memTemplParams" colspan="2">template&lt;typename T &gt; </td></tr>
<tr class="memitem:adfb2cae03ff36e40255d24195d9dad0d"><td class="memTemplItemLeft" align="right" valign="top"><a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt; T &gt;&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="../../da/d4a/classcv_1_1Quat.html#adfb2cae03ff36e40255d24195d9dad0d">tanh</a> (const <a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt; T &gt; &amp;q)</td></tr>
<tr class="memdesc:adfb2cae03ff36e40255d24195d9dad0d"><td class="mdescLeft">&#160;</td><td class="mdescRight">return tanh value of quaternion q, tanh could be calculated as: </p><p class="formulaDsp">
\[ \tanh(q) = \frac{\sinh(q)}{\cosh(q)}.\]
</p>
  <a href="#adfb2cae03ff36e40255d24195d9dad0d">More...</a><br /></td></tr>
<tr class="separator:adfb2cae03ff36e40255d24195d9dad0d"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><h3>template&lt;typename _Tp&gt;<br />
class cv::Quat&lt; _Tp &gt;</h3>

<p>Quaternion is a number system that extends the complex numbers. It can be expressed as a rotation in three-dimensional space. A quaternion is generally represented in the form: </p><p class="formulaDsp">
\[q = w + x\boldsymbol{i} + y\boldsymbol{j} + z\boldsymbol{k}\]
</p>
 <p class="formulaDsp">
\[q = [w, x, y, z]\]
</p>
 <p class="formulaDsp">
\[q = [w, \boldsymbol{v}] \]
</p>
 <p class="formulaDsp">
\[q = ||q||[\cos\psi, u_x\sin\psi,u_y\sin\psi, u_z\sin\psi].\]
</p>
 <p class="formulaDsp">
\[q = ||q||[\cos\psi, \boldsymbol{u}\sin\psi]\]
</p>
<p> where \(\psi = \frac{\theta}{2}\), \(\theta\) represents rotation angle, \(\boldsymbol{u} = [u_x, u_y, u_z]\) represents normalized rotation axis, and \(||q||\) represents the norm of \(q\).</p>
<p>A unit quaternion is usually represents rotation, which has the form: </p><p class="formulaDsp">
\[q = [\cos\psi, u_x\sin\psi,u_y\sin\psi, u_z\sin\psi].\]
</p>
<p>To create a quaternion representing the rotation around the axis \(\boldsymbol{u}\) with angle \(\theta\), you can use </p><div class="fragment"><div class="line"><span class="keyword">using namespace </span><a class="code" href="../../d2/d75/namespacecv.html">cv</a>;</div><div class="line"><span class="keywordtype">double</span> angle = <a class="code" href="../../db/de0/group__core__utils.html#ga677b89fae9308b340ddaebf0dba8455f">CV_PI</a>;</div><div class="line"><a class="code" href="../../d6/dcf/classcv_1_1Vec.html">Vec3d</a> axis = {0, 0, 1};</div><div class="line"><a class="code" href="../../da/d4a/classcv_1_1Quat.html">Quatd</a> q = <a class="code" href="../../da/d4a/classcv_1_1Quat.html#ab9b2bcb68e895895e61c826223e1ab55">Quatd::createFromAngleAxis</a>(angle, axis);</div></div><!-- fragment --><p>You can simply use four same type number to create a quaternion </p><div class="fragment"><div class="line"><a class="code" href="../../d0/de1/group__core.html#ga649715908b1dc7fc2496df48dd5fff64">Quatd</a> q(1, 2, 3, 4);</div></div><!-- fragment --><p> Or use a Vec4d or Vec4f vector. </p><div class="fragment"><div class="line"><a class="code" href="../../dc/d84/group__core__basic.html#ga41502c424d368098331a348dc26141bf">Vec4d</a> vec{1, 2, 3, 4};</div><div class="line"><a class="code" href="../../d0/de1/group__core.html#ga649715908b1dc7fc2496df48dd5fff64">Quatd</a> q(vec);</div></div><!-- fragment --><div class="fragment"><div class="line"><a class="code" href="../../dc/d84/group__core__basic.html#ga4f29b2178d21a471ee688b14d66d6567">Vec4f</a> vec{1, 2, 3, 4};</div><div class="line"><a class="code" href="../../d0/de1/group__core.html#gab0a5d5b9880b016c8995411a572353e2">Quatf</a> q(vec);</div></div><!-- fragment --><p>If you already have a 3x3 rotation matrix R, then you can use </p><div class="fragment"><div class="line"><a class="code" href="../../d0/de1/group__core.html#ga649715908b1dc7fc2496df48dd5fff64">Quatd</a> q = <a class="code" href="../../da/d4a/classcv_1_1Quat.html#a52446abf008a34e85d9f66cd105cb0f6">Quatd::createFromRotMat</a>(R);</div></div><!-- fragment --><p>If you already have a rotation vector rvec which has the form of <code>angle * axis</code>, then you can use </p><div class="fragment"><div class="line"><a class="code" href="../../d0/de1/group__core.html#ga649715908b1dc7fc2496df48dd5fff64">Quatd</a> q = <a class="code" href="../../da/d4a/classcv_1_1Quat.html#ae473706f7c8378b0948cf6036dbd0c2d">Quatd::createFromRvec</a>(rvec);</div></div><!-- fragment --><p>To extract the rotation matrix from quaternion, see <a class="el" href="../../da/d4a/classcv_1_1Quat.html#a3d7acac76ca39522aaa3df9cd45ee1cf" title="transform a quaternion to a 3x3 rotation matrix. ">toRotMat3x3()</a></p>
<p>To extract the Vec4d or Vec4f, see <a class="el" href="../../da/d4a/classcv_1_1Quat.html#ab22aeadc6a73208bb62570ccf631c02d" title="transform the this quaternion to a Vec&lt;T, 4&gt;. ">toVec()</a></p>
<p>To extract the rotation vector, see <a class="el" href="../../da/d4a/classcv_1_1Quat.html#ae4f521aba52df53f7484655dba8075de" title="transform this quaternion to a Rotation vector. ">toRotVec()</a></p>
<p>If there are two quaternions \(q_0, q_1\) are needed to interpolate, you can use <a class="el" href="../../da/d4a/classcv_1_1Quat.html#ab718c0c09577eb599f77a1a9cf083eec" title="To calculate the interpolation from  to  by Normalized Linear Interpolation(Nlerp). it returns a normalized quaternion of Linear Interpolation(Lerp).  The interpolation will always choose the shortest path but the constant speed is not guaranteed. ">nlerp()</a>, <a class="el" href="../../da/d4a/classcv_1_1Quat.html#a576b87e4b1c1b9682694be796b97b23b" title="To calculate the interpolation between  and  by Spherical Linear Interpolation(Slerp), which can be defined as:  where  can be calculated as:  resulting from the both of their norm is unit. ">slerp()</a> or <a class="el" href="../../da/d4a/classcv_1_1Quat.html#aa9f545f7df73a8a1635ceda2a0464362" title="to calculate a quaternion which is the result of a  continuous spline curve constructed by squad at t...">spline()</a> </p><div class="fragment"><div class="line"><a class="code" href="../../da/d4a/classcv_1_1Quat.html#ab718c0c09577eb599f77a1a9cf083eec">Quatd::nlerp</a>(q0, q1, t)</div><div class="line"></div><div class="line"><a class="code" href="../../da/d4a/classcv_1_1Quat.html#a576b87e4b1c1b9682694be796b97b23b">Quatd::slerp</a>(q0, q1, t)</div><div class="line"></div><div class="line"><a class="code" href="../../da/d4a/classcv_1_1Quat.html#aa9f545f7df73a8a1635ceda2a0464362">Quatd::spline</a>(q0, q0, q1, q1, t)</div></div><!-- fragment --><p> spline can smoothly connect rotations of multiple quaternions</p>
<p>Three ways to get an element in Quaternion </p><div class="fragment"><div class="line"><a class="code" href="../../d0/de1/group__core.html#gab0a5d5b9880b016c8995411a572353e2">Quatf</a> q(1,2,3,4);</div><div class="line">std::cout &lt;&lt; q.w &lt;&lt; std::endl; <span class="comment">// w=1, x=2, y=3, z=4</span></div><div class="line">std::cout &lt;&lt; q[0] &lt;&lt; std::endl; <span class="comment">// q[0]=1, q[1]=2, q[2]=3, q[3]=4</span></div><div class="line">std::cout &lt;&lt; q.at(0) &lt;&lt; std::endl;</div></div><!-- fragment --> </div><h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a id="a40cb6433e291eac3b32622a3359078b9"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a40cb6433e291eac3b32622a3359078b9">&#9670;&nbsp;</a></span>Quat() <span class="overload">[1/3]</span></h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename _Tp&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="../../da/d4a/classcv_1_1Quat.html">cv::Quat</a>&lt; _Tp &gt;::<a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a> </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a id="acffde8aa7474c625aa57040f47324cdf"></a>
<h2 class="memtitle"><span class="permalink"><a href="#acffde8aa7474c625aa57040f47324cdf">&#9670;&nbsp;</a></span>Quat() <span class="overload">[2/3]</span></h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename _Tp&gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="../../da/d4a/classcv_1_1Quat.html">cv::Quat</a>&lt; _Tp &gt;::<a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a> </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="../../d6/dcf/classcv_1_1Vec.html">Vec</a>&lt; _Tp, 4 &gt; &amp;&#160;</td>
          <td class="paramname"><em>coeff</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">explicit</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>From Vec4d or Vec4f. </p>

</div>
</div>
<a id="ac4f908ea3ad1532f1a438e9b049de408"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac4f908ea3ad1532f1a438e9b049de408">&#9670;&nbsp;</a></span>Quat() <span class="overload">[3/3]</span></h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename _Tp&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="../../da/d4a/classcv_1_1Quat.html">cv::Quat</a>&lt; _Tp &gt;::<a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a> </td>
          <td>(</td>
          <td class="paramtype">_Tp&#160;</td>
          <td class="paramname"><em>w</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">_Tp&#160;</td>
          <td class="paramname"><em>x</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">_Tp&#160;</td>
          <td class="paramname"><em>y</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">_Tp&#160;</td>
          <td class="paramname"><em>z</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>from four numbers. </p>

</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a id="a5125ead334093d651bf3ce982490007b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a5125ead334093d651bf3ce982490007b">&#9670;&nbsp;</a></span>acos()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename _Tp&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt;_Tp&gt; <a class="el" href="../../da/d4a/classcv_1_1Quat.html">cv::Quat</a>&lt; _Tp &gt;::acos </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>return arccos value of this quaternion, arccos could be calculated as: </p><p class="formulaDsp">
\[\arccos(q) = -\frac{\boldsymbol{v}}{||\boldsymbol{v}||}arccosh(q)\]
</p>
<p> where \(\boldsymbol{v} = [x, y, z].\) </p>
<p>For example </p><div class="fragment"><div class="line"><a class="code" href="../../d0/de1/group__core.html#ga649715908b1dc7fc2496df48dd5fff64">Quatd</a> q(1,2,3,4);</div><div class="line">q.acos();</div></div><!-- fragment --> 
</div>
</div>
<a id="a67afde4bb8288c5ae606d3aae5b7bb8b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a67afde4bb8288c5ae606d3aae5b7bb8b">&#9670;&nbsp;</a></span>acosh()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename _Tp&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt;_Tp&gt; <a class="el" href="../../da/d4a/classcv_1_1Quat.html">cv::Quat</a>&lt; _Tp &gt;::acosh </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>return arccosh value of this quaternion, arccosh could be calculated as: </p><p class="formulaDsp">
\[arcosh(q) = \ln(q + \sqrt{q^2 - 1})\]
</p>
<p>. </p>
<p>For example </p><div class="fragment"><div class="line"><a class="code" href="../../d0/de1/group__core.html#ga649715908b1dc7fc2496df48dd5fff64">Quatd</a> q(1,2,3,4);</div><div class="line">q.acosh();</div></div><!-- fragment --> 
</div>
</div>
<a id="aa084d62b9e250dffe63b2c940a904765"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aa084d62b9e250dffe63b2c940a904765">&#9670;&nbsp;</a></span>asin()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename _Tp&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt;_Tp&gt; <a class="el" href="../../da/d4a/classcv_1_1Quat.html">cv::Quat</a>&lt; _Tp &gt;::asin </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>return arcsin value of this quaternion, arcsin could be calculated as: </p><p class="formulaDsp">
\[\arcsin(q) = -\frac{\boldsymbol{v}}{||\boldsymbol{v}||}arcsinh(q\frac{\boldsymbol{v}}{||\boldsymbol{v}||})\]
</p>
<p> where \(\boldsymbol{v} = [x, y, z].\) </p>
<p>For example </p><div class="fragment"><div class="line"><a class="code" href="../../d0/de1/group__core.html#ga649715908b1dc7fc2496df48dd5fff64">Quatd</a> q(1,2,3,4);</div><div class="line">q.asin();</div></div><!-- fragment --> 
</div>
</div>
<a id="a12e169c174809e62abbc16dd1bd63a05"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a12e169c174809e62abbc16dd1bd63a05">&#9670;&nbsp;</a></span>asinh()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename _Tp&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt;_Tp&gt; <a class="el" href="../../da/d4a/classcv_1_1Quat.html">cv::Quat</a>&lt; _Tp &gt;::asinh </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>return arcsinh value of this quaternion, arcsinh could be calculated as: </p><p class="formulaDsp">
\[arcsinh(q) = \ln(q + \sqrt{q^2 + 1})\]
</p>
<p>. </p>
<p>For example </p><div class="fragment"><div class="line"><a class="code" href="../../d0/de1/group__core.html#ga649715908b1dc7fc2496df48dd5fff64">Quatd</a> q(1,2,3,4);</div><div class="line">q.asinh();</div></div><!-- fragment --> 
</div>
</div>
<a id="ac21b01e626dc888bdf69d0f1f7d8b060"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac21b01e626dc888bdf69d0f1f7d8b060">&#9670;&nbsp;</a></span>assertNormal()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename _Tp&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="../../da/d4a/classcv_1_1Quat.html">cv::Quat</a>&lt; _Tp &gt;::assertNormal </td>
          <td>(</td>
          <td class="paramtype">_Tp&#160;</td>
          <td class="paramname"><em>eps</em> = <code><a class="el" href="../../da/d4a/classcv_1_1Quat.html#a10e3525ee098693c55b6ec47a9ac6c11">CV_QUAT_EPS</a></code></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>to throw an error if this quaternion is not a unit quaternion. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">eps</td><td>tolerance scope of normalization. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="../../da/d4a/classcv_1_1Quat.html#a5c555f37ea9df65d7486ca234cc57c46" title="return true if this quaternion is a unit quaternion. ">isNormal</a> </dd></dl>

</div>
</div>
<a id="aee1c99898d16d0954135b8432980004b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aee1c99898d16d0954135b8432980004b">&#9670;&nbsp;</a></span>at()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename _Tp&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">_Tp <a class="el" href="../../da/d4a/classcv_1_1Quat.html">cv::Quat</a>&lt; _Tp &gt;::at </td>
          <td>(</td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>index</em></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>a way to get element. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">index</td><td>over a range [0, 3].</td></tr>
  </table>
  </dd>
</dl>
<p>A quaternion q</p>
<p>q.at(0) is equivalent to q.w,</p>
<p>q.at(1) is equivalent to q.x,</p>
<p>q.at(2) is equivalent to q.y,</p>
<p>q.at(3) is equivalent to q.z. </p>

</div>
</div>
<a id="ac9f4087dd676854b97f5a8ce63beaa62"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac9f4087dd676854b97f5a8ce63beaa62">&#9670;&nbsp;</a></span>atan()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename _Tp&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt;_Tp&gt; <a class="el" href="../../da/d4a/classcv_1_1Quat.html">cv::Quat</a>&lt; _Tp &gt;::atan </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>return arctan value of this quaternion, arctan could be calculated as: </p><p class="formulaDsp">
\[\arctan(q) = -\frac{\boldsymbol{v}}{||\boldsymbol{v}||}arctanh(q\frac{\boldsymbol{v}}{||\boldsymbol{v}||})\]
</p>
<p> where \(\boldsymbol{v} = [x, y, z].\) </p>
<p>For example </p><div class="fragment"><div class="line"><a class="code" href="../../d0/de1/group__core.html#ga649715908b1dc7fc2496df48dd5fff64">Quatd</a> q(1,2,3,4);</div><div class="line">q.atan();</div></div><!-- fragment --> 
</div>
</div>
<a id="ad818d4a92c0093fd75a7b2750b17a89a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ad818d4a92c0093fd75a7b2750b17a89a">&#9670;&nbsp;</a></span>atanh()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename _Tp&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt;_Tp&gt; <a class="el" href="../../da/d4a/classcv_1_1Quat.html">cv::Quat</a>&lt; _Tp &gt;::atanh </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>return arctanh value of this quaternion, arctanh could be calculated as: </p><p class="formulaDsp">
\[arcsinh(q) = \frac{\ln(q + 1) - \ln(1 - q)}{2}\]
</p>
<p>. </p>
<p>For example </p><div class="fragment"><div class="line"><a class="code" href="../../d0/de1/group__core.html#ga649715908b1dc7fc2496df48dd5fff64">Quatd</a> q(1,2,3,4);</div><div class="line">q.atanh();</div></div><!-- fragment --> 
</div>
</div>
<a id="aaf7616da34fcea4abdd2c7f76f0e2edc"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aaf7616da34fcea4abdd2c7f76f0e2edc">&#9670;&nbsp;</a></span>conjugate()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename _Tp&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt;_Tp&gt; <a class="el" href="../../da/d4a/classcv_1_1Quat.html">cv::Quat</a>&lt; _Tp &gt;::conjugate </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>return the conjugate of this quaternion. </p><p class="formulaDsp">
\[q.conjugate() = (w, -x, -y, -z).\]
</p>
 </p>

</div>
</div>
<a id="a20cf4c9219906bae81210fd8dc01e176"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a20cf4c9219906bae81210fd8dc01e176">&#9670;&nbsp;</a></span>cos()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename _Tp&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt;_Tp&gt; <a class="el" href="../../da/d4a/classcv_1_1Quat.html">cv::Quat</a>&lt; _Tp &gt;::cos </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>return cos value of this quaternion, cos could be calculated as: </p><p class="formulaDsp">
\[\cos(p) = \cos(w) * \cosh(||\boldsymbol{v}||) - \sin(w)\frac{\boldsymbol{v}}{||\boldsymbol{v}||}\sinh(||\boldsymbol{v}||)\]
</p>
<p> where \(\boldsymbol{v} = [x, y, z].\) </p>
<p>For example </p><div class="fragment"><div class="line"><a class="code" href="../../d0/de1/group__core.html#ga649715908b1dc7fc2496df48dd5fff64">Quatd</a> q(1,2,3,4);</div><div class="line">q.cos();</div></div><!-- fragment --> 
</div>
</div>
<a id="ac18ecd261065fa7546bedc9e937121b8"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac18ecd261065fa7546bedc9e937121b8">&#9670;&nbsp;</a></span>cosh()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename _Tp&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt;_Tp&gt; <a class="el" href="../../da/d4a/classcv_1_1Quat.html">cv::Quat</a>&lt; _Tp &gt;::cosh </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>return cosh value of this quaternion, cosh could be calculated as: </p><p class="formulaDsp">
\[\cosh(p) = \cosh(w) * \cos(||\boldsymbol{v}||) + \sinh(w)\frac{\boldsymbol{v}}{||\boldsymbol{v}||}sin(||\boldsymbol{v}||)\]
</p>
<p> where \(\boldsymbol{v} = [x, y, z].\) </p>
<p>For example </p><div class="fragment"><div class="line"><a class="code" href="../../d0/de1/group__core.html#ga649715908b1dc7fc2496df48dd5fff64">Quatd</a> q(1,2,3,4);</div><div class="line">q.cosh();</div></div><!-- fragment --> 
</div>
</div>
<a id="ab9b2bcb68e895895e61c826223e1ab55"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ab9b2bcb68e895895e61c826223e1ab55">&#9670;&nbsp;</a></span>createFromAngleAxis()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename _Tp&gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static <a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt;_Tp&gt; <a class="el" href="../../da/d4a/classcv_1_1Quat.html">cv::Quat</a>&lt; _Tp &gt;::createFromAngleAxis </td>
          <td>(</td>
          <td class="paramtype">const _Tp&#160;</td>
          <td class="paramname"><em>angle</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="../../d6/dcf/classcv_1_1Vec.html">Vec</a>&lt; _Tp, 3 &gt; &amp;&#160;</td>
          <td class="paramname"><em>axis</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>from an angle, axis. Axis will be normalized in this function. And it generates </p><p class="formulaDsp">
\[q = [\cos\psi, u_x\sin\psi,u_y\sin\psi, u_z\sin\psi].\]
</p>
<p> where \(\psi = \frac{\theta}{2}\), \(\theta\) is the rotation angle. </p>

</div>
</div>
<a id="a3b7e4952ad0eb8663533f3b408838597"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a3b7e4952ad0eb8663533f3b408838597">&#9670;&nbsp;</a></span>createFromEulerAngles()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename _Tp&gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static <a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt;_Tp&gt; <a class="el" href="../../da/d4a/classcv_1_1Quat.html">cv::Quat</a>&lt; _Tp &gt;::createFromEulerAngles </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="../../d6/dcf/classcv_1_1Vec.html">Vec</a>&lt; _Tp, 3 &gt; &amp;&#160;</td>
          <td class="paramname"><em>angles</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../d2/d53/classcv_1_1QuatEnum.html#abceb161bc29a481f2f55439ec723ee45">QuatEnum::EulerAnglesType</a>&#160;</td>
          <td class="paramname"><em>eulerAnglesType</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>from Euler angles </p>
<p>A quaternion can be generated from Euler angles by combining the quaternion representations of the Euler rotations.</p>
<p>For example, if we use intrinsic rotations in the order of X-Y-Z, \(\theta_1 \) is rotation around the X-axis, \(\theta_2 \) is rotation around the Y-axis, \(\theta_3 \) is rotation around the Z-axis. The final quaternion q can be calculated by</p>
<p class="formulaDsp">
\[ {q} = q_{X, \theta_1} q_{Y, \theta_2} q_{Z, \theta_3}\]
</p>
<p> where \( q_{X, \theta_1} \) is created from <a class="el" href="../../da/d4a/classcv_1_1Quat.html#afc0cafb971db6965a2d975f9546c9863">createFromXRot</a>, \( q_{Y, \theta_2} \) is created from <a class="el" href="../../da/d4a/classcv_1_1Quat.html#ad993413035fa0b9fc7929ccb103d68db">createFromYRot</a>, \( q_{Z, \theta_3} \) is created from <a class="el" href="../../da/d4a/classcv_1_1Quat.html#a9169918a8b2b9467d69c3730d33738fc">createFromZRot</a>. </p><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">angles</td><td>the Euler angles in a vector of length 3 </td></tr>
    <tr><td class="paramname">eulerAnglesType</td><td>the convertion Euler angles type </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="a52446abf008a34e85d9f66cd105cb0f6"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a52446abf008a34e85d9f66cd105cb0f6">&#9670;&nbsp;</a></span>createFromRotMat()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename _Tp&gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static <a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt;_Tp&gt; <a class="el" href="../../da/d4a/classcv_1_1Quat.html">cv::Quat</a>&lt; _Tp &gt;::createFromRotMat </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a>&#160;</td>
          <td class="paramname"><em>R</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>from a 3x3 rotation matrix. </p>

</div>
</div>
<a id="ae473706f7c8378b0948cf6036dbd0c2d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ae473706f7c8378b0948cf6036dbd0c2d">&#9670;&nbsp;</a></span>createFromRvec()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename _Tp&gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static <a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt;_Tp&gt; <a class="el" href="../../da/d4a/classcv_1_1Quat.html">cv::Quat</a>&lt; _Tp &gt;::createFromRvec </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a>&#160;</td>
          <td class="paramname"><em>rvec</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>from a rotation vector \(r\) has the form \(\theta \cdot \boldsymbol{u}\), where \(\theta\) represents rotation angle and \(\boldsymbol{u}\) represents normalized rotation axis. </p>
<p>Angle and axis could be easily derived as: </p><p class="formulaDsp">
\[ \begin{equation} \begin{split} \psi &amp;= ||r||\\ \boldsymbol{u} &amp;= \frac{r}{\theta} \end{split} \end{equation} \]
</p>
<p> Then a quaternion can be calculated by </p><p class="formulaDsp">
\[q = [\cos\psi, \boldsymbol{u}\sin\psi]\]
</p>
<p> where \(\psi = \theta / 2 \) </p>

</div>
</div>
<a id="afc0cafb971db6965a2d975f9546c9863"></a>
<h2 class="memtitle"><span class="permalink"><a href="#afc0cafb971db6965a2d975f9546c9863">&#9670;&nbsp;</a></span>createFromXRot()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename _Tp&gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static <a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt;_Tp&gt; <a class="el" href="../../da/d4a/classcv_1_1Quat.html">cv::Quat</a>&lt; _Tp &gt;::createFromXRot </td>
          <td>(</td>
          <td class="paramtype">const _Tp&#160;</td>
          <td class="paramname"><em>theta</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>get a quaternion from a rotation about the X-axis by \(\theta\) . </p><p class="formulaDsp">
\[q = \cos(\theta/2)+sin(\theta/2) i +0 j +0 k \]
</p>
 </p>

</div>
</div>
<a id="ad993413035fa0b9fc7929ccb103d68db"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ad993413035fa0b9fc7929ccb103d68db">&#9670;&nbsp;</a></span>createFromYRot()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename _Tp&gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static <a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt;_Tp&gt; <a class="el" href="../../da/d4a/classcv_1_1Quat.html">cv::Quat</a>&lt; _Tp &gt;::createFromYRot </td>
          <td>(</td>
          <td class="paramtype">const _Tp&#160;</td>
          <td class="paramname"><em>theta</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>get a quaternion from a rotation about the Y-axis by \(\theta\) . </p><p class="formulaDsp">
\[q = \cos(\theta/2)+0 i+ sin(\theta/2) j +0k \]
</p>
 </p>

</div>
</div>
<a id="a9169918a8b2b9467d69c3730d33738fc"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a9169918a8b2b9467d69c3730d33738fc">&#9670;&nbsp;</a></span>createFromZRot()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename _Tp&gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static <a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt;_Tp&gt; <a class="el" href="../../da/d4a/classcv_1_1Quat.html">cv::Quat</a>&lt; _Tp &gt;::createFromZRot </td>
          <td>(</td>
          <td class="paramtype">const _Tp&#160;</td>
          <td class="paramname"><em>theta</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>get a quaternion from a rotation about the Z-axis by \(\theta\). </p><p class="formulaDsp">
\[q = \cos(\theta/2)+0 i +0 j +sin(\theta/2) k \]
</p>
 </p>

</div>
</div>
<a id="af498bcbdb751ee90b06f7ce42ff47c6f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#af498bcbdb751ee90b06f7ce42ff47c6f">&#9670;&nbsp;</a></span>crossProduct()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename _Tp&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt;_Tp&gt; <a class="el" href="../../da/d4a/classcv_1_1Quat.html">cv::Quat</a>&lt; _Tp &gt;::crossProduct </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt; _Tp &gt; &amp;&#160;</td>
          <td class="paramname"><em>q</em></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>return the crossProduct between \(p = (a, b, c, d) = (a, \boldsymbol{u})\) and \(q = (w, x, y, z) = (w, \boldsymbol{v})\). </p><p class="formulaDsp">
\[p \times q = \frac{pq- qp}{2}.\]
</p>
 <p class="formulaDsp">
\[p \times q = \boldsymbol{u} \times \boldsymbol{v}.\]
</p>
 <p class="formulaDsp">
\[p \times q = (cz-dy)i + (dx-bz)j + (by-xc)k. \]
</p>
 </p>
<p>For example </p><div class="fragment"><div class="line"><a class="code" href="../../d0/de1/group__core.html#ga649715908b1dc7fc2496df48dd5fff64">Quatd</a> q{1,2,3,4};</div><div class="line"><a class="code" href="../../d0/de1/group__core.html#ga649715908b1dc7fc2496df48dd5fff64">Quatd</a> p{5,6,7,8};</div><div class="line">p.crossProduct(q)</div></div><!-- fragment --> 
</div>
</div>
<a id="a06faebf4b5163be987dcfd4aa463bfed"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a06faebf4b5163be987dcfd4aa463bfed">&#9670;&nbsp;</a></span>dot()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename _Tp&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">_Tp <a class="el" href="../../da/d4a/classcv_1_1Quat.html">cv::Quat</a>&lt; _Tp &gt;::dot </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt; _Tp &gt;&#160;</td>
          <td class="paramname"><em>q</em></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>return the dot between quaternion \(q\) and this quaternion. </p>
<p>dot(p, q) is a good metric of how close the quaternions are. Indeed, consider the unit quaternion difference \(p^{-1} * q\), its real part is dot(p, q). At the same time its real part is equal to \(\cos(\beta/2)\) where \(\beta\) is an angle of rotation between p and q, i.e., Therefore, the closer dot(p, q) to 1, the smaller rotation between them. </p><p class="formulaDsp">
\[p \cdot q = p.w \cdot q.w + p.x \cdot q.x + p.y \cdot q.y + p.z \cdot q.z\]
</p>
 <dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">q</td><td>the other quaternion.</td></tr>
  </table>
  </dd>
</dl>
<p>For example </p><div class="fragment"><div class="line"><a class="code" href="../../d0/de1/group__core.html#ga649715908b1dc7fc2496df48dd5fff64">Quatd</a> q(1,2,3,4);</div><div class="line"><a class="code" href="../../d0/de1/group__core.html#ga649715908b1dc7fc2496df48dd5fff64">Quatd</a> p(5,6,7,8);</div><div class="line">p.dot(q);</div></div><!-- fragment --> 
</div>
</div>
<a id="acb646a572c605b3ea5d5b08bb2fb3aa1"></a>
<h2 class="memtitle"><span class="permalink"><a href="#acb646a572c605b3ea5d5b08bb2fb3aa1">&#9670;&nbsp;</a></span>exp()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename _Tp&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt;_Tp&gt; <a class="el" href="../../da/d4a/classcv_1_1Quat.html">cv::Quat</a>&lt; _Tp &gt;::exp </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>return the value of exponential value. </p><p class="formulaDsp">
\[\exp(q) = e^w (\cos||\boldsymbol{v}||+ \frac{v}{||\boldsymbol{v}||}\sin||\boldsymbol{v}||)\]
</p>
<p> where \(\boldsymbol{v} = [x, y, z].\) </p>
<p>For example </p><div class="fragment"><div class="line"><a class="code" href="../../d0/de1/group__core.html#ga649715908b1dc7fc2496df48dd5fff64">Quatd</a> q{1,2,3,4};</div><div class="line">cout &lt;&lt; q.exp() &lt;&lt; endl;</div></div><!-- fragment --> 
</div>
</div>
<a id="a305053004bb816fe41062fcb2fd0f6d7"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a305053004bb816fe41062fcb2fd0f6d7">&#9670;&nbsp;</a></span>getAngle()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename _Tp&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">_Tp <a class="el" href="../../da/d4a/classcv_1_1Quat.html">cv::Quat</a>&lt; _Tp &gt;::getAngle </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="../../d0/de1/group__core.html#ga935c8234953e2a2c8557c019ad8d509e">QuatAssumeType</a>&#160;</td>
          <td class="paramname"><em>assumeUnit</em> = <code><a class="el" href="../../d0/de1/group__core.html#gga935c8234953e2a2c8557c019ad8d509ea786f758552bf7be9ee5f12ca2157cf8f">QUAT_ASSUME_NOT_UNIT</a></code></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>get the angle of quaternion, it returns the rotation angle. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">assumeUnit</td><td>if QUAT_ASSUME_UNIT, this quaternion assume to be a unit quaternion and this function will save some computations. <p class="formulaDsp">
\[\psi = 2 *arccos(\frac{w}{||q||})\]
</p>
</td></tr>
  </table>
  </dd>
</dl>
<p>For example </p><div class="fragment"><div class="line"><a class="code" href="../../d0/de1/group__core.html#ga649715908b1dc7fc2496df48dd5fff64">Quatd</a> q(1,2,3,4);</div><div class="line">q.getAngle();</div><div class="line"></div><div class="line"><a class="code" href="../../d0/de1/group__core.html#ga935c8234953e2a2c8557c019ad8d509e">QuatAssumeType</a> assumeUnit = <a class="code" href="../../d0/de1/group__core.html#gga935c8234953e2a2c8557c019ad8d509ea87af033c2248f7a0b4548ffa56afc697">QUAT_ASSUME_UNIT</a>;</div><div class="line">q.normalize().getAngle(assumeUnit);<span class="comment">//same as q.getAngle().</span></div></div><!-- fragment --> <dl class="section note"><dt>Note</dt><dd>It always return the value between \([0, 2\pi]\). </dd></dl>

</div>
</div>
<a id="aedc187e57a36dc8bd6fd1ac23f5bd1f1"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aedc187e57a36dc8bd6fd1ac23f5bd1f1">&#9670;&nbsp;</a></span>getAxis()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename _Tp&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="../../d6/dcf/classcv_1_1Vec.html">Vec</a>&lt;_Tp, 3&gt; <a class="el" href="../../da/d4a/classcv_1_1Quat.html">cv::Quat</a>&lt; _Tp &gt;::getAxis </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="../../d0/de1/group__core.html#ga935c8234953e2a2c8557c019ad8d509e">QuatAssumeType</a>&#160;</td>
          <td class="paramname"><em>assumeUnit</em> = <code><a class="el" href="../../d0/de1/group__core.html#gga935c8234953e2a2c8557c019ad8d509ea786f758552bf7be9ee5f12ca2157cf8f">QUAT_ASSUME_NOT_UNIT</a></code></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>get the axis of quaternion, it returns a vector of length 3. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">assumeUnit</td><td>if QUAT_ASSUME_UNIT, this quaternion assume to be a unit quaternion and this function will save some computations.</td></tr>
  </table>
  </dd>
</dl>
<p>the unit axis \(\boldsymbol{u}\) is defined by </p><p class="formulaDsp">
\[\begin{equation} \begin{split} \boldsymbol{v} &amp;= \boldsymbol{u} ||\boldsymbol{v}||\\ &amp;= \boldsymbol{u}||q||sin(\frac{\theta}{2}) \end{split} \end{equation}\]
</p>
<p> where \(v=[x, y ,z]\) and \(\theta\) represents rotation angle.</p>
<p>For example </p><div class="fragment"><div class="line"><a class="code" href="../../d0/de1/group__core.html#ga649715908b1dc7fc2496df48dd5fff64">Quatd</a> q(1,2,3,4);</div><div class="line">q.getAxis();</div><div class="line"></div><div class="line"><a class="code" href="../../d0/de1/group__core.html#ga935c8234953e2a2c8557c019ad8d509e">QuatAssumeType</a> assumeUnit = <a class="code" href="../../d0/de1/group__core.html#gga935c8234953e2a2c8557c019ad8d509ea87af033c2248f7a0b4548ffa56afc697">QUAT_ASSUME_UNIT</a>;</div><div class="line">q.normalize().getAxis(assumeUnit);<span class="comment">//same as q.getAxis()</span></div></div><!-- fragment --> 
</div>
</div>
<a id="a8872c3d9bddaea12532e3181d32e21f2"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a8872c3d9bddaea12532e3181d32e21f2">&#9670;&nbsp;</a></span>interPoint()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename _Tp&gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static <a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt;_Tp&gt; <a class="el" href="../../da/d4a/classcv_1_1Quat.html">cv::Quat</a>&lt; _Tp &gt;::interPoint </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt; _Tp &gt; &amp;&#160;</td>
          <td class="paramname"><em>q0</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt; _Tp &gt; &amp;&#160;</td>
          <td class="paramname"><em>q1</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt; _Tp &gt; &amp;&#160;</td>
          <td class="paramname"><em>q2</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../d0/de1/group__core.html#ga935c8234953e2a2c8557c019ad8d509e">QuatAssumeType</a>&#160;</td>
          <td class="paramname"><em>assumeUnit</em> = <code><a class="el" href="../../d0/de1/group__core.html#gga935c8234953e2a2c8557c019ad8d509ea786f758552bf7be9ee5f12ca2157cf8f">QUAT_ASSUME_NOT_UNIT</a></code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>This is the part calculation of squad. To calculate the intermedia quaternion \(s_i\) between each three quaternion </p><p class="formulaDsp">
\[s_i = q_i\exp(-\frac{\log(q^*_iq_{i+1}) + \log(q^*_iq_{i-1})}{4}).\]
</p>
<p>. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">q0</td><td>the first quaternion. </td></tr>
    <tr><td class="paramname">q1</td><td>the second quaternion. </td></tr>
    <tr><td class="paramname">q2</td><td>the third quaternion. </td></tr>
    <tr><td class="paramname">assumeUnit</td><td>if QUAT_ASSUME_UNIT, all input quaternions assume to be unit quaternion. Otherwise, all input quaternions will be normalized inside the function. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="../../da/d4a/classcv_1_1Quat.html#aeec581d46d161f89b8c19f396e491cf2" title="To calculate the interpolation between , , ,  by Spherical and quadrangle(Squad). This could be defin...">squad</a> </dd></dl>

</div>
</div>
<a id="a490a6eb0ebee1ced3b6e1d84a8e9d48d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a490a6eb0ebee1ced3b6e1d84a8e9d48d">&#9670;&nbsp;</a></span>inv()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename _Tp&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt;_Tp&gt; <a class="el" href="../../da/d4a/classcv_1_1Quat.html">cv::Quat</a>&lt; _Tp &gt;::inv </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="../../d0/de1/group__core.html#ga935c8234953e2a2c8557c019ad8d509e">QuatAssumeType</a>&#160;</td>
          <td class="paramname"><em>assumeUnit</em> = <code><a class="el" href="../../d0/de1/group__core.html#gga935c8234953e2a2c8557c019ad8d509ea786f758552bf7be9ee5f12ca2157cf8f">QUAT_ASSUME_NOT_UNIT</a></code></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>return \(q^{-1}\) which is an inverse of \(q\) satisfying \(q * q^{-1} = 1\). </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">assumeUnit</td><td>if QUAT_ASSUME_UNIT, quaternion q assume to be a unit quaternion and this function will save some computations.</td></tr>
  </table>
  </dd>
</dl>
<p>For example </p><div class="fragment"><div class="line"><a class="code" href="../../d0/de1/group__core.html#ga649715908b1dc7fc2496df48dd5fff64">Quatd</a> q(1,2,3,4);</div><div class="line">q.inv();</div><div class="line"></div><div class="line"><a class="code" href="../../d0/de1/group__core.html#ga935c8234953e2a2c8557c019ad8d509e">QuatAssumeType</a> assumeUnit = <a class="code" href="../../d0/de1/group__core.html#gga935c8234953e2a2c8557c019ad8d509ea87af033c2248f7a0b4548ffa56afc697">QUAT_ASSUME_UNIT</a>;</div><div class="line">q = q.normalize();</div><div class="line">q.inv(assumeUnit);  <span class="comment">//assumeUnit means p is a unit quaternion</span></div></div><!-- fragment --> 
</div>
</div>
<a id="a5c555f37ea9df65d7486ca234cc57c46"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a5c555f37ea9df65d7486ca234cc57c46">&#9670;&nbsp;</a></span>isNormal()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename _Tp&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">bool <a class="el" href="../../da/d4a/classcv_1_1Quat.html">cv::Quat</a>&lt; _Tp &gt;::isNormal </td>
          <td>(</td>
          <td class="paramtype">_Tp&#160;</td>
          <td class="paramname"><em>eps</em> = <code><a class="el" href="../../da/d4a/classcv_1_1Quat.html#a10e3525ee098693c55b6ec47a9ac6c11">CV_QUAT_EPS</a></code></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>return true if this quaternion is a unit quaternion. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">eps</td><td>tolerance scope of normalization. The eps could be defined as</td></tr>
  </table>
  </dd>
</dl>
<p class="formulaDsp">
\[eps = |1 - dotValue|\]
</p>
<p> where </p><p class="formulaDsp">
\[dotValue = (this.w^2 + this.x^2 + this,y^2 + this.z^2).\]
</p>
<p> And this function will consider it is normalized when the dotValue over a range \([1-eps, 1+eps]\). </p>

</div>
</div>
<a id="a0b24cb7b28c8f7dafd10efd64c8e339d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a0b24cb7b28c8f7dafd10efd64c8e339d">&#9670;&nbsp;</a></span>lerp()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename _Tp&gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static <a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt;_Tp&gt; <a class="el" href="../../da/d4a/classcv_1_1Quat.html">cv::Quat</a>&lt; _Tp &gt;::lerp </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt; _Tp &gt; &amp;&#160;</td>
          <td class="paramname"><em>q0</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt; _Tp &gt; &amp;&#160;</td>
          <td class="paramname"><em>q1</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const _Tp&#160;</td>
          <td class="paramname"><em>t</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>To calculate the interpolation from \(q_0\) to \(q_1\) by Linear Interpolation(Nlerp) For two quaternions, this interpolation curve can be displayed as: </p><p class="formulaDsp">
\[Lerp(q_0, q_1, t) = (1 - t)q_0 + tq_1.\]
</p>
<p> Obviously, the lerp will interpolate along a straight line if we think of \(q_0\) and \(q_1\) as a vector in a two-dimensional space. When \(t = 0\), it returns \(q_0\) and when \(t= 1\), it returns \(q_1\). \(t\) should to be ranged in \([0, 1]\) normally. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">q0</td><td>a quaternion used in linear interpolation. </td></tr>
    <tr><td class="paramname">q1</td><td>a quaternion used in linear interpolation. </td></tr>
    <tr><td class="paramname">t</td><td>percent of vector \(\overrightarrow{q_0q_1}\) over a range [0, 1]. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section note"><dt>Note</dt><dd>it returns a non-unit quaternion. </dd></dl>

</div>
</div>
<a id="a85994160793847a57d9c38d883493dec"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a85994160793847a57d9c38d883493dec">&#9670;&nbsp;</a></span>log()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename _Tp&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt;_Tp&gt; <a class="el" href="../../da/d4a/classcv_1_1Quat.html">cv::Quat</a>&lt; _Tp &gt;::log </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="../../d0/de1/group__core.html#ga935c8234953e2a2c8557c019ad8d509e">QuatAssumeType</a>&#160;</td>
          <td class="paramname"><em>assumeUnit</em> = <code><a class="el" href="../../d0/de1/group__core.html#gga935c8234953e2a2c8557c019ad8d509ea786f758552bf7be9ee5f12ca2157cf8f">QUAT_ASSUME_NOT_UNIT</a></code></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>return the value of logarithm function. </p><p class="formulaDsp">
\[\ln(q) = \ln||q|| + \frac{\boldsymbol{v}}{||\boldsymbol{v}||}\arccos\frac{w}{||q||}\]
</p>
<p>. where \(\boldsymbol{v} = [x, y, z].\) </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">assumeUnit</td><td>if QUAT_ASSUME_UNIT, this quaternion assume to be a unit quaternion and this function will save some computations.</td></tr>
  </table>
  </dd>
</dl>
<p>For example </p><div class="fragment"><div class="line"><a class="code" href="../../d0/de1/group__core.html#ga649715908b1dc7fc2496df48dd5fff64">Quatd</a> q(1,2,3,4);</div><div class="line">q.log();</div><div class="line"></div><div class="line"><a class="code" href="../../d0/de1/group__core.html#ga935c8234953e2a2c8557c019ad8d509e">QuatAssumeType</a> assumeUnit = <a class="code" href="../../d0/de1/group__core.html#gga935c8234953e2a2c8557c019ad8d509ea87af033c2248f7a0b4548ffa56afc697">QUAT_ASSUME_UNIT</a>;</div><div class="line"><a class="code" href="../../d0/de1/group__core.html#ga649715908b1dc7fc2496df48dd5fff64">Quatd</a> q1(1,2,3,4);</div><div class="line">q1.normalize().log(assumeUnit);</div></div><!-- fragment --> 
</div>
</div>
<a id="ab718c0c09577eb599f77a1a9cf083eec"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ab718c0c09577eb599f77a1a9cf083eec">&#9670;&nbsp;</a></span>nlerp()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename _Tp&gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static <a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt;_Tp&gt; <a class="el" href="../../da/d4a/classcv_1_1Quat.html">cv::Quat</a>&lt; _Tp &gt;::nlerp </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt; _Tp &gt; &amp;&#160;</td>
          <td class="paramname"><em>q0</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt; _Tp &gt; &amp;&#160;</td>
          <td class="paramname"><em>q1</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const _Tp&#160;</td>
          <td class="paramname"><em>t</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../d0/de1/group__core.html#ga935c8234953e2a2c8557c019ad8d509e">QuatAssumeType</a>&#160;</td>
          <td class="paramname"><em>assumeUnit</em> = <code><a class="el" href="../../d0/de1/group__core.html#gga935c8234953e2a2c8557c019ad8d509ea786f758552bf7be9ee5f12ca2157cf8f">QUAT_ASSUME_NOT_UNIT</a></code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>To calculate the interpolation from \(q_0\) to \(q_1\) by Normalized Linear Interpolation(Nlerp). it returns a normalized quaternion of Linear Interpolation(Lerp). </p><p class="formulaDsp">
\[ Nlerp(q_0, q_1, t) = \frac{(1 - t)q_0 + tq_1}{||(1 - t)q_0 + tq_1||}.\]
</p>
<p> The interpolation will always choose the shortest path but the constant speed is not guaranteed. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">q0</td><td>a quaternion used in normalized linear interpolation. </td></tr>
    <tr><td class="paramname">q1</td><td>a quaternion used in normalized linear interpolation. </td></tr>
    <tr><td class="paramname">t</td><td>percent of vector \(\overrightarrow{q_0q_1}\) over a range [0, 1]. </td></tr>
    <tr><td class="paramname">assumeUnit</td><td>if QUAT_ASSUME_UNIT, all input quaternions assume to be unit quaternion. Otherwise, all inputs quaternion will be normalized inside the function. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="../../da/d4a/classcv_1_1Quat.html#a0b24cb7b28c8f7dafd10efd64c8e339d" title="To calculate the interpolation from  to  by Linear Interpolation(Nlerp) For two quaternions, this interpolation curve can be displayed as:  Obviously, the lerp will interpolate along a straight line if we think of  and  as a vector in a two-dimensional space. When , it returns  and when , it returns .  should to be ranged in  normally. ">lerp</a> </dd></dl>

</div>
</div>
<a id="abf08767595e119eee2f101420f7b9c24"></a>
<h2 class="memtitle"><span class="permalink"><a href="#abf08767595e119eee2f101420f7b9c24">&#9670;&nbsp;</a></span>norm()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename _Tp&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">_Tp <a class="el" href="../../da/d4a/classcv_1_1Quat.html">cv::Quat</a>&lt; _Tp &gt;::norm </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>return the norm of quaternion. </p><p class="formulaDsp">
\[||q|| = \sqrt{w^2 + x^2 + y^2 + z^2}.\]
</p>
 </p>

</div>
</div>
<a id="a91f5fa95882bf5bfad5f9cb18297e085"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a91f5fa95882bf5bfad5f9cb18297e085">&#9670;&nbsp;</a></span>normalize()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename _Tp&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt;_Tp&gt; <a class="el" href="../../da/d4a/classcv_1_1Quat.html">cv::Quat</a>&lt; _Tp &gt;::normalize </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>return a normalized \(p\). </p><p class="formulaDsp">
\[p = \frac{q}{||q||}\]
</p>
<p> where \(p\) satisfies \((p.x)^2 + (p.y)^2 + (p.z)^2 + (p.w)^2 = 1.\) </p>

</div>
</div>
<a id="a0837a42d59c5bbbf435beb5c4b1e52b3"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a0837a42d59c5bbbf435beb5c4b1e52b3">&#9670;&nbsp;</a></span>operator*()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename _Tp&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt;_Tp&gt; <a class="el" href="../../da/d4a/classcv_1_1Quat.html">cv::Quat</a>&lt; _Tp &gt;::operator* </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt; _Tp &gt; &amp;&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Multiplication operator of two quaternions q and p. Multiplies values on either side of the operator. </p>
<p>Rule of quaternion multiplication: </p><p class="formulaDsp">
\[ \begin{equation} \begin{split} p * q &amp;= [p_0, \boldsymbol{u}]*[q_0, \boldsymbol{v}]\\ &amp;=[p_0q_0 - \boldsymbol{u}\cdot \boldsymbol{v}, p_0\boldsymbol{v} + q_0\boldsymbol{u}+ \boldsymbol{u}\times \boldsymbol{v}]. \end{split} \end{equation} \]
</p>
<p> where \(\cdot\) means dot product and \(\times \) means cross product.</p>
<p>For example </p><div class="fragment"><div class="line"><a class="code" href="../../d0/de1/group__core.html#ga649715908b1dc7fc2496df48dd5fff64">Quatd</a> p{1, 2, 3, 4};</div><div class="line"><a class="code" href="../../d0/de1/group__core.html#ga649715908b1dc7fc2496df48dd5fff64">Quatd</a> q{5, 6, 7, 8};</div><div class="line">std::cout &lt;&lt; p * q &lt;&lt; std::endl; <span class="comment">//[-60, 12, 30, 24]</span></div></div><!-- fragment --> 
</div>
</div>
<a id="a2ea6a27a6d5b211cae33be00a031c65e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a2ea6a27a6d5b211cae33be00a031c65e">&#9670;&nbsp;</a></span>operator*=() <span class="overload">[1/2]</span></h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename _Tp&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt;_Tp&gt;&amp; <a class="el" href="../../da/d4a/classcv_1_1Quat.html">cv::Quat</a>&lt; _Tp &gt;::operator*= </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt; _Tp &gt; &amp;&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Multiplication assignment operator of two quaternions q and p. It multiplies right operand with the left operand and assign the result to left operand. </p>
<p>Rule of quaternion multiplication: </p><p class="formulaDsp">
\[ \begin{equation} \begin{split} p * q &amp;= [p_0, \boldsymbol{u}]*[q_0, \boldsymbol{v}]\\ &amp;=[p_0q_0 - \boldsymbol{u}\cdot \boldsymbol{v}, p_0\boldsymbol{v} + q_0\boldsymbol{u}+ \boldsymbol{u}\times \boldsymbol{v}]. \end{split} \end{equation} \]
</p>
<p> where \(\cdot\) means dot product and \(\times \) means cross product.</p>
<p>For example </p><div class="fragment"><div class="line"><a class="code" href="../../d0/de1/group__core.html#ga649715908b1dc7fc2496df48dd5fff64">Quatd</a> p{1, 2, 3, 4};</div><div class="line"><a class="code" href="../../d0/de1/group__core.html#ga649715908b1dc7fc2496df48dd5fff64">Quatd</a> q{5, 6, 7, 8};</div><div class="line">p *= q; <span class="comment">// equivalent to p = p * q</span></div><div class="line">std::cout &lt;&lt; p &lt;&lt; std::endl; <span class="comment">//[-60, 12, 30, 24]</span></div></div><!-- fragment --> 
</div>
</div>
<a id="a93f614ab00b038a6427a4137cc8982e7"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a93f614ab00b038a6427a4137cc8982e7">&#9670;&nbsp;</a></span>operator*=() <span class="overload">[2/2]</span></h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename _Tp&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt;_Tp&gt;&amp; <a class="el" href="../../da/d4a/classcv_1_1Quat.html">cv::Quat</a>&lt; _Tp &gt;::operator*= </td>
          <td>(</td>
          <td class="paramtype">const _Tp&#160;</td>
          <td class="paramname"><em>s</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Multiplication assignment operator of a quaternions and a scalar. It multiplies right operand with the left operand and assign the result to left operand. </p>
<p>Rule of quaternion multiplication with a scalar: </p><p class="formulaDsp">
\[ \begin{equation} \begin{split} p * s &amp;= [w, x, y, z] * s\\ &amp;=[w * s, x * s, y * s, z * s]. \end{split} \end{equation} \]
</p>
<p>For example </p><div class="fragment"><div class="line"><a class="code" href="../../d0/de1/group__core.html#ga649715908b1dc7fc2496df48dd5fff64">Quatd</a> p{1, 2, 3, 4};</div><div class="line"><span class="keywordtype">double</span> s = 2.0;</div><div class="line">p *= s; <span class="comment">// equivalent to p = p * s</span></div><div class="line">std::cout &lt;&lt; p &lt;&lt; std::endl; <span class="comment">//[2.0, 4.0, 6.0, 8.0]</span></div></div><!-- fragment --> <dl class="section note"><dt>Note</dt><dd>the type of scalar should be equal to the quaternion. </dd></dl>

</div>
</div>
<a id="ab32e1bf6a03279a78ef8752233e71686"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ab32e1bf6a03279a78ef8752233e71686">&#9670;&nbsp;</a></span>operator+()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename _Tp&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt;_Tp&gt; <a class="el" href="../../da/d4a/classcv_1_1Quat.html">cv::Quat</a>&lt; _Tp &gt;::operator+ </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt; _Tp &gt; &amp;&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Addition operator of two quaternions p and q. It returns a new quaternion that each value is the sum of \(p_i\) and \(q_i\). </p>
<p>For example </p><div class="fragment"><div class="line"><a class="code" href="../../d0/de1/group__core.html#ga649715908b1dc7fc2496df48dd5fff64">Quatd</a> p{1, 2, 3, 4};</div><div class="line"><a class="code" href="../../d0/de1/group__core.html#ga649715908b1dc7fc2496df48dd5fff64">Quatd</a> q{5, 6, 7, 8};</div><div class="line">std::cout &lt;&lt; p + q &lt;&lt; std::endl; <span class="comment">//[6, 8, 10, 12]</span></div></div><!-- fragment --> 
</div>
</div>
<a id="a37f911ebb0a13e449a09c819c6bbaddb"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a37f911ebb0a13e449a09c819c6bbaddb">&#9670;&nbsp;</a></span>operator+=()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename _Tp&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt;_Tp&gt;&amp; <a class="el" href="../../da/d4a/classcv_1_1Quat.html">cv::Quat</a>&lt; _Tp &gt;::operator+= </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt; _Tp &gt; &amp;&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Addition assignment operator of two quaternions p and q. It adds right operand to the left operand and assign the result to left operand. </p>
<p>For example </p><div class="fragment"><div class="line"><a class="code" href="../../d0/de1/group__core.html#ga649715908b1dc7fc2496df48dd5fff64">Quatd</a> p{1, 2, 3, 4};</div><div class="line"><a class="code" href="../../d0/de1/group__core.html#ga649715908b1dc7fc2496df48dd5fff64">Quatd</a> q{5, 6, 7, 8};</div><div class="line">p += q; <span class="comment">// equivalent to p = p + q</span></div><div class="line">std::cout &lt;&lt; p &lt;&lt; std::endl; <span class="comment">//[6, 8, 10, 12]</span></div></div><!-- fragment --> 
</div>
</div>
<a id="a71348b2a7699dddb5108544eb17ab7db"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a71348b2a7699dddb5108544eb17ab7db">&#9670;&nbsp;</a></span>operator-() <span class="overload">[1/2]</span></h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename _Tp&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt;_Tp&gt; <a class="el" href="../../da/d4a/classcv_1_1Quat.html">cv::Quat</a>&lt; _Tp &gt;::operator- </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Return opposite quaternion \(-p\) which satisfies \(p + (-p) = 0.\). </p>
<p>For example </p><div class="fragment"><div class="line"><a class="code" href="../../d0/de1/group__core.html#ga649715908b1dc7fc2496df48dd5fff64">Quatd</a> q{1, 2, 3, 4};</div><div class="line">std::cout &lt;&lt; -q &lt;&lt; std::endl; <span class="comment">// [-1, -2, -3, -4]</span></div></div><!-- fragment --> 
</div>
</div>
<a id="afe0f5e293bc012dba035c69827de71f9"></a>
<h2 class="memtitle"><span class="permalink"><a href="#afe0f5e293bc012dba035c69827de71f9">&#9670;&nbsp;</a></span>operator-() <span class="overload">[2/2]</span></h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename _Tp&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt;_Tp&gt; <a class="el" href="../../da/d4a/classcv_1_1Quat.html">cv::Quat</a>&lt; _Tp &gt;::operator- </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt; _Tp &gt; &amp;&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Subtraction operator of two quaternions p and q. It returns a new quaternion that each value is the sum of \(p_i\) and \(-q_i\). </p>
<p>For example </p><div class="fragment"><div class="line"><a class="code" href="../../d0/de1/group__core.html#ga649715908b1dc7fc2496df48dd5fff64">Quatd</a> p{1, 2, 3, 4};</div><div class="line"><a class="code" href="../../d0/de1/group__core.html#ga649715908b1dc7fc2496df48dd5fff64">Quatd</a> q{5, 6, 7, 8};</div><div class="line">std::cout &lt;&lt; p - q &lt;&lt; std::endl; <span class="comment">//[-4, -4, -4, -4]</span></div></div><!-- fragment --> 
</div>
</div>
<a id="ac98891daea0b395e3fa3e4ecd8431d5a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac98891daea0b395e3fa3e4ecd8431d5a">&#9670;&nbsp;</a></span>operator-=()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename _Tp&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt;_Tp&gt;&amp; <a class="el" href="../../da/d4a/classcv_1_1Quat.html">cv::Quat</a>&lt; _Tp &gt;::operator-= </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt; _Tp &gt; &amp;&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Subtraction assignment operator of two quaternions p and q. It subtracts right operand from the left operand and assign the result to left operand. </p>
<p>For example </p><div class="fragment"><div class="line"><a class="code" href="../../d0/de1/group__core.html#ga649715908b1dc7fc2496df48dd5fff64">Quatd</a> p{1, 2, 3, 4};</div><div class="line"><a class="code" href="../../d0/de1/group__core.html#ga649715908b1dc7fc2496df48dd5fff64">Quatd</a> q{5, 6, 7, 8};</div><div class="line">p -= q; <span class="comment">// equivalent to p = p - q</span></div><div class="line">std::cout &lt;&lt; p &lt;&lt; std::endl; <span class="comment">//[-4, -4, -4, -4]</span></div></div><!-- fragment --> 
</div>
</div>
<a id="ab62225241515e49b7938f1fed16b17de"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ab62225241515e49b7938f1fed16b17de">&#9670;&nbsp;</a></span>operator/() <span class="overload">[1/2]</span></h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename _Tp&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt;_Tp&gt; <a class="el" href="../../da/d4a/classcv_1_1Quat.html">cv::Quat</a>&lt; _Tp &gt;::operator/ </td>
          <td>(</td>
          <td class="paramtype">const _Tp&#160;</td>
          <td class="paramname"><em>s</em></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Division operator of a quaternions and a scalar. It divides left operand with the right operand and assign the result to left operand. </p>
<p>Rule of quaternion division with a scalar: </p><p class="formulaDsp">
\[ \begin{equation} \begin{split} p / s &amp;= [w, x, y, z] / s\\ &amp;=[w/s, x/s, y/s, z/s]. \end{split} \end{equation} \]
</p>
<p>For example </p><div class="fragment"><div class="line"><a class="code" href="../../d0/de1/group__core.html#ga649715908b1dc7fc2496df48dd5fff64">Quatd</a> p{1, 2, 3, 4};</div><div class="line"><span class="keywordtype">double</span> s = 2.0;</div><div class="line">p /= s; <span class="comment">// equivalent to p = p / s</span></div><div class="line">std::cout &lt;&lt; p &lt;&lt; std::endl; <span class="comment">//[0.5, 1, 1.5, 2]</span></div></div><!-- fragment --> <dl class="section note"><dt>Note</dt><dd>the type of scalar should be equal to this quaternion. </dd></dl>

</div>
</div>
<a id="ad670ebda552693adbfc512b80f24119e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ad670ebda552693adbfc512b80f24119e">&#9670;&nbsp;</a></span>operator/() <span class="overload">[2/2]</span></h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename _Tp&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt;_Tp&gt; <a class="el" href="../../da/d4a/classcv_1_1Quat.html">cv::Quat</a>&lt; _Tp &gt;::operator/ </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt; _Tp &gt; &amp;&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Division operator of two quaternions p and q. Divides left hand operand by right hand operand. </p>
<p>Rule of quaternion division with a scalar: </p><p class="formulaDsp">
\[ \begin{equation} \begin{split} p / q &amp;= p * q.inv()\\ \end{split} \end{equation} \]
</p>
<p>For example </p><div class="fragment"><div class="line"><a class="code" href="../../d0/de1/group__core.html#ga649715908b1dc7fc2496df48dd5fff64">Quatd</a> p{1, 2, 3, 4};</div><div class="line"><a class="code" href="../../d0/de1/group__core.html#ga649715908b1dc7fc2496df48dd5fff64">Quatd</a> q{5, 6, 7, 8};</div><div class="line">std::cout &lt;&lt; p / q &lt;&lt; std::endl; <span class="comment">// equivalent to p * q.inv()</span></div></div><!-- fragment --> 
</div>
</div>
<a id="ab42ddebef690e0f8fec8b5196bd7af3d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ab42ddebef690e0f8fec8b5196bd7af3d">&#9670;&nbsp;</a></span>operator/=() <span class="overload">[1/2]</span></h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename _Tp&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt;_Tp&gt;&amp; <a class="el" href="../../da/d4a/classcv_1_1Quat.html">cv::Quat</a>&lt; _Tp &gt;::operator/= </td>
          <td>(</td>
          <td class="paramtype">const _Tp&#160;</td>
          <td class="paramname"><em>s</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Division assignment operator of a quaternions and a scalar. It divides left operand with the right operand and assign the result to left operand. </p>
<p>Rule of quaternion division with a scalar: </p><p class="formulaDsp">
\[ \begin{equation} \begin{split} p / s &amp;= [w, x, y, z] / s\\ &amp;=[w / s, x / s, y / s, z / s]. \end{split} \end{equation} \]
</p>
<p>For example </p><div class="fragment"><div class="line"><a class="code" href="../../d0/de1/group__core.html#ga649715908b1dc7fc2496df48dd5fff64">Quatd</a> p{1, 2, 3, 4};</div><div class="line"><span class="keywordtype">double</span> s = 2.0;;</div><div class="line">p /= s; <span class="comment">// equivalent to p = p / s</span></div><div class="line">std::cout &lt;&lt; p &lt;&lt; std::endl; <span class="comment">//[0.5, 1.0, 1.5, 2.0]</span></div></div><!-- fragment --> <dl class="section note"><dt>Note</dt><dd>the type of scalar should be equal to the quaternion. </dd></dl>

</div>
</div>
<a id="aa3bd08f9e7ffcb2ee62ff92c24cf17df"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aa3bd08f9e7ffcb2ee62ff92c24cf17df">&#9670;&nbsp;</a></span>operator/=() <span class="overload">[2/2]</span></h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename _Tp&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt;_Tp&gt;&amp; <a class="el" href="../../da/d4a/classcv_1_1Quat.html">cv::Quat</a>&lt; _Tp &gt;::operator/= </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt; _Tp &gt; &amp;&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Division assignment operator of two quaternions p and q; It divides left operand with the right operand and assign the result to left operand. </p>
<p>Rule of quaternion division with a quaternion: </p><p class="formulaDsp">
\[ \begin{equation} \begin{split} p / q&amp;= p * q.inv()\\ \end{split} \end{equation} \]
</p>
<p>For example </p><div class="fragment"><div class="line"><a class="code" href="../../d0/de1/group__core.html#ga649715908b1dc7fc2496df48dd5fff64">Quatd</a> p{1, 2, 3, 4};</div><div class="line"><a class="code" href="../../d0/de1/group__core.html#ga649715908b1dc7fc2496df48dd5fff64">Quatd</a> q{5, 6, 7, 8};</div><div class="line">p /= q; <span class="comment">// equivalent to p = p * q.inv()</span></div><div class="line">std::cout &lt;&lt; p &lt;&lt; std::endl;</div></div><!-- fragment --> 
</div>
</div>
<a id="a1ce2829104f53d64fc24c8b4510f69de"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a1ce2829104f53d64fc24c8b4510f69de">&#9670;&nbsp;</a></span>operator==()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename _Tp&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">bool <a class="el" href="../../da/d4a/classcv_1_1Quat.html">cv::Quat</a>&lt; _Tp &gt;::operator== </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt; _Tp &gt; &amp;&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>return true if two quaternions p and q are nearly equal, i.e. when the absolute value of each \(p_i\) and \(q_i\) is less than CV_QUAT_EPS. </p>

</div>
</div>
<a id="a786d0ccdcfd4aedb8327a50746133d07"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a786d0ccdcfd4aedb8327a50746133d07">&#9670;&nbsp;</a></span>operator[]() <span class="overload">[1/2]</span></h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename _Tp&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">_Tp&amp; <a class="el" href="../../da/d4a/classcv_1_1Quat.html">cv::Quat</a>&lt; _Tp &gt;::operator[] </td>
          <td>(</td>
          <td class="paramtype">std::size_t&#160;</td>
          <td class="paramname"><em>n</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a id="adb5d2a8c84e39398f05cf6d72a8fb50e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#adb5d2a8c84e39398f05cf6d72a8fb50e">&#9670;&nbsp;</a></span>operator[]() <span class="overload">[2/2]</span></h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename _Tp&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">const _Tp&amp; <a class="el" href="../../da/d4a/classcv_1_1Quat.html">cv::Quat</a>&lt; _Tp &gt;::operator[] </td>
          <td>(</td>
          <td class="paramtype">std::size_t&#160;</td>
          <td class="paramname"><em>n</em></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a id="af16b8dfb0acf34fc917f05de288daa22"></a>
<h2 class="memtitle"><span class="permalink"><a href="#af16b8dfb0acf34fc917f05de288daa22">&#9670;&nbsp;</a></span>power() <span class="overload">[1/2]</span></h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename _Tp&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt;_Tp&gt; <a class="el" href="../../da/d4a/classcv_1_1Quat.html">cv::Quat</a>&lt; _Tp &gt;::power </td>
          <td>(</td>
          <td class="paramtype">const _Tp&#160;</td>
          <td class="paramname"><em>x</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../d0/de1/group__core.html#ga935c8234953e2a2c8557c019ad8d509e">QuatAssumeType</a>&#160;</td>
          <td class="paramname"><em>assumeUnit</em> = <code><a class="el" href="../../d0/de1/group__core.html#gga935c8234953e2a2c8557c019ad8d509ea786f758552bf7be9ee5f12ca2157cf8f">QUAT_ASSUME_NOT_UNIT</a></code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td> const</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>return the value of power function with index \(x\). </p><p class="formulaDsp">
\[q^x = ||q||(\cos(x\theta) + \boldsymbol{u}\sin(x\theta))).\]
</p>
 </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">x</td><td>index of exponentiation. </td></tr>
    <tr><td class="paramname">assumeUnit</td><td>if QUAT_ASSUME_UNIT, this quaternion assume to be a unit quaternion and this function will save some computations.</td></tr>
  </table>
  </dd>
</dl>
<p>For example </p><div class="fragment"><div class="line"><a class="code" href="../../d0/de1/group__core.html#ga649715908b1dc7fc2496df48dd5fff64">Quatd</a> q(1,2,3,4);</div><div class="line">q.power(2.0);</div><div class="line"></div><div class="line"><a class="code" href="../../d0/de1/group__core.html#ga935c8234953e2a2c8557c019ad8d509e">QuatAssumeType</a> assumeUnit = <a class="code" href="../../d0/de1/group__core.html#gga935c8234953e2a2c8557c019ad8d509ea87af033c2248f7a0b4548ffa56afc697">QUAT_ASSUME_UNIT</a>;</div><div class="line"><span class="keywordtype">double</span> angle = <a class="code" href="../../db/de0/group__core__utils.html#ga677b89fae9308b340ddaebf0dba8455f">CV_PI</a>;</div><div class="line"><a class="code" href="../../dc/d84/group__core__basic.html#ga370d94209693b5b13437ab4991cabf73">Vec3d</a> axis{0, 0, 1};</div><div class="line"><a class="code" href="../../d0/de1/group__core.html#ga649715908b1dc7fc2496df48dd5fff64">Quatd</a> q1 = <a class="code" href="../../da/d4a/classcv_1_1Quat.html#ab9b2bcb68e895895e61c826223e1ab55">Quatd::createFromAngleAxis</a>(angle, axis); <span class="comment">//generate a unit quat by axis and angle</span></div><div class="line">q1.power(2.0, assumeUnit); <span class="comment">//This assumeUnt means q1 is a unit quaternion</span></div></div><!-- fragment --> 
</div>
</div>
<a id="a3026b0565b06af9ff97806032a746594"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a3026b0565b06af9ff97806032a746594">&#9670;&nbsp;</a></span>power() <span class="overload">[2/2]</span></h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename _Tp&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt;_Tp&gt; <a class="el" href="../../da/d4a/classcv_1_1Quat.html">cv::Quat</a>&lt; _Tp &gt;::power </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt; _Tp &gt; &amp;&#160;</td>
          <td class="paramname"><em>q</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../d0/de1/group__core.html#ga935c8234953e2a2c8557c019ad8d509e">QuatAssumeType</a>&#160;</td>
          <td class="paramname"><em>assumeUnit</em> = <code><a class="el" href="../../d0/de1/group__core.html#gga935c8234953e2a2c8557c019ad8d509ea786f758552bf7be9ee5f12ca2157cf8f">QUAT_ASSUME_NOT_UNIT</a></code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td> const</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>return the value of power function with quaternion \(q\). </p><p class="formulaDsp">
\[p^q = e^{q\ln(p)}.\]
</p>
 </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">q</td><td>index quaternion of power function. </td></tr>
    <tr><td class="paramname">assumeUnit</td><td>if QUAT_ASSUME_UNIT, this quaternion assume to be a unit quaternion and this function will save some computations.</td></tr>
  </table>
  </dd>
</dl>
<p>For example </p><div class="fragment"><div class="line"><a class="code" href="../../d0/de1/group__core.html#ga649715908b1dc7fc2496df48dd5fff64">Quatd</a> p(1,2,3,4);</div><div class="line"><a class="code" href="../../d0/de1/group__core.html#ga649715908b1dc7fc2496df48dd5fff64">Quatd</a> q(5,6,7,8);</div><div class="line">p.power(q);</div><div class="line"></div><div class="line"><a class="code" href="../../d0/de1/group__core.html#ga935c8234953e2a2c8557c019ad8d509e">QuatAssumeType</a> assumeUnit = <a class="code" href="../../d0/de1/group__core.html#gga935c8234953e2a2c8557c019ad8d509ea87af033c2248f7a0b4548ffa56afc697">QUAT_ASSUME_UNIT</a>;</div><div class="line">p = p.normalize();</div><div class="line">p.power(q, assumeUnit); <span class="comment">//This assumeUnit means p is a unit quaternion</span></div></div><!-- fragment --> 
</div>
</div>
<a id="a88d9b4b0497741ba741118fb9c626ed7"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a88d9b4b0497741ba741118fb9c626ed7">&#9670;&nbsp;</a></span>sin()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename _Tp&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt;_Tp&gt; <a class="el" href="../../da/d4a/classcv_1_1Quat.html">cv::Quat</a>&lt; _Tp &gt;::sin </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>return sin value of this quaternion, sin could be calculated as: </p><p class="formulaDsp">
\[\sin(p) = \sin(w) * \cosh(||\boldsymbol{v}||) + \cos(w)\frac{\boldsymbol{v}}{||\boldsymbol{v}||}\sinh(||\boldsymbol{v}||)\]
</p>
<p> where \(\boldsymbol{v} = [x, y, z].\) </p>
<p>For example </p><div class="fragment"><div class="line"><a class="code" href="../../d0/de1/group__core.html#ga649715908b1dc7fc2496df48dd5fff64">Quatd</a> q(1,2,3,4);</div><div class="line">q.sin();</div></div><!-- fragment --> 
</div>
</div>
<a id="a541f79fd2e9a99ac7cd39ebd499eca65"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a541f79fd2e9a99ac7cd39ebd499eca65">&#9670;&nbsp;</a></span>sinh()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename _Tp&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt;_Tp&gt; <a class="el" href="../../da/d4a/classcv_1_1Quat.html">cv::Quat</a>&lt; _Tp &gt;::sinh </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>return sinh value of this quaternion, sinh could be calculated as: \(\sinh(p) = \sin(w)\cos(||\boldsymbol{v}||) + \cosh(w)\frac{v}{||\boldsymbol{v}||}\sin||\boldsymbol{v}||\) where \(\boldsymbol{v} = [x, y, z].\) </p>
<p>For example </p><div class="fragment"><div class="line"><a class="code" href="../../d0/de1/group__core.html#ga649715908b1dc7fc2496df48dd5fff64">Quatd</a> q(1,2,3,4);</div><div class="line">q.sinh();</div></div><!-- fragment --> 
</div>
</div>
<a id="a576b87e4b1c1b9682694be796b97b23b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a576b87e4b1c1b9682694be796b97b23b">&#9670;&nbsp;</a></span>slerp()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename _Tp&gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static <a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt;_Tp&gt; <a class="el" href="../../da/d4a/classcv_1_1Quat.html">cv::Quat</a>&lt; _Tp &gt;::slerp </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt; _Tp &gt; &amp;&#160;</td>
          <td class="paramname"><em>q0</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt; _Tp &gt; &amp;&#160;</td>
          <td class="paramname"><em>q1</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const _Tp&#160;</td>
          <td class="paramname"><em>t</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../d0/de1/group__core.html#ga935c8234953e2a2c8557c019ad8d509e">QuatAssumeType</a>&#160;</td>
          <td class="paramname"><em>assumeUnit</em> = <code><a class="el" href="../../d0/de1/group__core.html#gga935c8234953e2a2c8557c019ad8d509ea786f758552bf7be9ee5f12ca2157cf8f">QUAT_ASSUME_NOT_UNIT</a></code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>directChange</em> = <code>true</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>To calculate the interpolation between \(q_0\) and \(q_1\) by Spherical Linear Interpolation(Slerp), which can be defined as: </p><p class="formulaDsp">
\[ Slerp(q_0, q_1, t) = \frac{\sin((1-t)\theta)}{\sin(\theta)}q_0 + \frac{\sin(t\theta)}{\sin(\theta)}q_1\]
</p>
<p> where \(\theta\) can be calculated as: </p><p class="formulaDsp">
\[\theta=cos^{-1}(q_0\cdot q_1)\]
</p>
<p> resulting from the both of their norm is unit. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">q0</td><td>a quaternion used in Slerp. </td></tr>
    <tr><td class="paramname">q1</td><td>a quaternion used in Slerp. </td></tr>
    <tr><td class="paramname">t</td><td>percent of angle between \(q_0\) and \(q_1\) over a range [0, 1]. </td></tr>
    <tr><td class="paramname">assumeUnit</td><td>if QUAT_ASSUME_UNIT, all input quaternions assume to be unit quaternions. Otherwise, all input quaternions will be normalized inside the function. </td></tr>
    <tr><td class="paramname">directChange</td><td>if QUAT_ASSUME_UNIT, the interpolation will choose the nearest path. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section note"><dt>Note</dt><dd>If the interpolation angle is small, the error between Nlerp and Slerp is not so large. To improve efficiency and avoid zero division error, we use Nlerp instead of Slerp. </dd></dl>

</div>
</div>
<a id="aa9f545f7df73a8a1635ceda2a0464362"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aa9f545f7df73a8a1635ceda2a0464362">&#9670;&nbsp;</a></span>spline()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename _Tp&gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static <a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt;_Tp&gt; <a class="el" href="../../da/d4a/classcv_1_1Quat.html">cv::Quat</a>&lt; _Tp &gt;::spline </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt; _Tp &gt; &amp;&#160;</td>
          <td class="paramname"><em>q0</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt; _Tp &gt; &amp;&#160;</td>
          <td class="paramname"><em>q1</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt; _Tp &gt; &amp;&#160;</td>
          <td class="paramname"><em>q2</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt; _Tp &gt; &amp;&#160;</td>
          <td class="paramname"><em>q3</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const _Tp&#160;</td>
          <td class="paramname"><em>t</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../d0/de1/group__core.html#ga935c8234953e2a2c8557c019ad8d509e">QuatAssumeType</a>&#160;</td>
          <td class="paramname"><em>assumeUnit</em> = <code><a class="el" href="../../d0/de1/group__core.html#gga935c8234953e2a2c8557c019ad8d509ea786f758552bf7be9ee5f12ca2157cf8f">QUAT_ASSUME_NOT_UNIT</a></code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>to calculate a quaternion which is the result of a \(C^1\) continuous spline curve constructed by squad at the ratio t. Here, the interpolation values are between \(q_1\) and \(q_2\). \(q_0\) and \(q_2\) are used to ensure the \(C^1\) continuity. if t = 0, it returns \(q_1\), if t = 1, it returns \(q_2\). </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">q0</td><td>the first input quaternion to ensure \(C^1\) continuity. </td></tr>
    <tr><td class="paramname">q1</td><td>the second input quaternion. </td></tr>
    <tr><td class="paramname">q2</td><td>the third input quaternion. </td></tr>
    <tr><td class="paramname">q3</td><td>the fourth input quaternion the same use of \(q1\). </td></tr>
    <tr><td class="paramname">t</td><td>ratio over a range [0, 1]. </td></tr>
    <tr><td class="paramname">assumeUnit</td><td>if QUAT_ASSUME_UNIT, \(q_0, q_1, q_2, q_3\) assume to be unit quaternion. Otherwise, all input quaternions will be normalized inside the function.</td></tr>
  </table>
  </dd>
</dl>
<p>For example:</p>
<p>If there are three double quaternions \(v_0, v_1, v_2\) waiting to be interpolated.</p>
<p>Interpolation between \(v_0\) and \(v_1\) with a ratio \(t_0\) could be calculated as </p><div class="fragment"><div class="line"><a class="code" href="../../da/d4a/classcv_1_1Quat.html#aa9f545f7df73a8a1635ceda2a0464362">Quatd::spline</a>(v0, v0, v1, v2, t0);</div></div><!-- fragment --><p> Interpolation between \(v_1\) and \(v_2\) with a ratio \(t_0\) could be calculated as </p><div class="fragment"><div class="line"><a class="code" href="../../da/d4a/classcv_1_1Quat.html#aa9f545f7df73a8a1635ceda2a0464362">Quatd::spline</a>(v0, v1, v2, v2, t0);</div></div><!-- fragment --> <dl class="section see"><dt>See also</dt><dd><a class="el" href="../../da/d4a/classcv_1_1Quat.html#aeec581d46d161f89b8c19f396e491cf2" title="To calculate the interpolation between , , ,  by Spherical and quadrangle(Squad). This could be defin...">squad</a>, <a class="el" href="../../da/d4a/classcv_1_1Quat.html#a576b87e4b1c1b9682694be796b97b23b" title="To calculate the interpolation between  and  by Spherical Linear Interpolation(Slerp), which can be defined as:  where  can be calculated as:  resulting from the both of their norm is unit. ">slerp</a> </dd></dl>

</div>
</div>
<a id="aada8d353a0a9a610973768f25a8aeeed"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aada8d353a0a9a610973768f25a8aeeed">&#9670;&nbsp;</a></span>sqrt()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename _Tp&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt;_Tp&gt; <a class="el" href="../../da/d4a/classcv_1_1Quat.html">cv::Quat</a>&lt; _Tp &gt;::sqrt </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="../../d0/de1/group__core.html#ga935c8234953e2a2c8557c019ad8d509e">QuatAssumeType</a>&#160;</td>
          <td class="paramname"><em>assumeUnit</em> = <code><a class="el" href="../../d0/de1/group__core.html#gga935c8234953e2a2c8557c019ad8d509ea786f758552bf7be9ee5f12ca2157cf8f">QUAT_ASSUME_NOT_UNIT</a></code></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>return \(\sqrt{q}\). </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">assumeUnit</td><td>if QUAT_ASSUME_UNIT, this quaternion assume to be a unit quaternion and this function will save some computations.</td></tr>
  </table>
  </dd>
</dl>
<p>For example </p><div class="fragment"><div class="line"><a class="code" href="../../d0/de1/group__core.html#gab0a5d5b9880b016c8995411a572353e2">Quatf</a> q(1,2,3,4);</div><div class="line">q.sqrt();</div><div class="line"></div><div class="line"><a class="code" href="../../d0/de1/group__core.html#ga935c8234953e2a2c8557c019ad8d509e">QuatAssumeType</a> assumeUnit = <a class="code" href="../../d0/de1/group__core.html#gga935c8234953e2a2c8557c019ad8d509ea87af033c2248f7a0b4548ffa56afc697">QUAT_ASSUME_UNIT</a>;</div><div class="line">q = {1,0,0,0};</div><div class="line">q.sqrt(assumeUnit); <span class="comment">//This assumeUnit means q is a unit quaternion</span></div></div><!-- fragment --> 
</div>
</div>
<a id="aeec581d46d161f89b8c19f396e491cf2"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aeec581d46d161f89b8c19f396e491cf2">&#9670;&nbsp;</a></span>squad()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename _Tp&gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static <a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt;_Tp&gt; <a class="el" href="../../da/d4a/classcv_1_1Quat.html">cv::Quat</a>&lt; _Tp &gt;::squad </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt; _Tp &gt; &amp;&#160;</td>
          <td class="paramname"><em>q0</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt; _Tp &gt; &amp;&#160;</td>
          <td class="paramname"><em>s0</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt; _Tp &gt; &amp;&#160;</td>
          <td class="paramname"><em>s1</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt; _Tp &gt; &amp;&#160;</td>
          <td class="paramname"><em>q1</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const _Tp&#160;</td>
          <td class="paramname"><em>t</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../d0/de1/group__core.html#ga935c8234953e2a2c8557c019ad8d509e">QuatAssumeType</a>&#160;</td>
          <td class="paramname"><em>assumeUnit</em> = <code><a class="el" href="../../d0/de1/group__core.html#gga935c8234953e2a2c8557c019ad8d509ea786f758552bf7be9ee5f12ca2157cf8f">QUAT_ASSUME_NOT_UNIT</a></code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>directChange</em> = <code>true</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>To calculate the interpolation between \(q_0\), \(q_1\), \(q_2\), \(q_3\) by Spherical and quadrangle(Squad). This could be defined as: </p><p class="formulaDsp">
\[Squad(q_i, s_i, s_{i+1}, q_{i+1}, t) = Slerp(Slerp(q_i, q_{i+1}, t), Slerp(s_i, s_{i+1}, t), 2t(1-t))\]
</p>
<p> where </p><p class="formulaDsp">
\[s_i = q_i\exp(-\frac{\log(q^*_iq_{i+1}) + \log(q^*_iq_{i-1})}{4})\]
</p>
<p>. </p>
<p>The Squad expression is analogous to the \(B\acute{e}zier\) curve, but involves spherical linear interpolation instead of simple linear interpolation. Each \(s_i\) needs to be calculated by three quaternions.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">q0</td><td>the first quaternion. </td></tr>
    <tr><td class="paramname">s0</td><td>the second quaternion. </td></tr>
    <tr><td class="paramname">s1</td><td>the third quaternion. </td></tr>
    <tr><td class="paramname">q1</td><td>thr fourth quaternion. </td></tr>
    <tr><td class="paramname">t</td><td>interpolation parameter of quadratic and linear interpolation over a range \([0, 1]\). </td></tr>
    <tr><td class="paramname">assumeUnit</td><td>if QUAT_ASSUME_UNIT, all input quaternions assume to be unit quaternion. Otherwise, all input quaternions will be normalized inside the function. </td></tr>
    <tr><td class="paramname">directChange</td><td>if QUAT_ASSUME_UNIT, squad will find the nearest path to interpolate. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="../../da/d4a/classcv_1_1Quat.html#a8872c3d9bddaea12532e3181d32e21f2" title="This is the part calculation of squad. To calculate the intermedia quaternion  between each three qua...">interPoint</a>, <a class="el" href="../../da/d4a/classcv_1_1Quat.html#aa9f545f7df73a8a1635ceda2a0464362" title="to calculate a quaternion which is the result of a  continuous spline curve constructed by squad at t...">spline</a> </dd></dl>

</div>
</div>
<a id="ade63bd7caefaf41312013f6529b50902"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ade63bd7caefaf41312013f6529b50902">&#9670;&nbsp;</a></span>tan()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename _Tp&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt;_Tp&gt; <a class="el" href="../../da/d4a/classcv_1_1Quat.html">cv::Quat</a>&lt; _Tp &gt;::tan </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>return tan value of this quaternion, tan could be calculated as: </p><p class="formulaDsp">
\[\tan(q) = \frac{\sin(q)}{\cos(q)}.\]
</p>
 </p>
<p>For example </p><div class="fragment"><div class="line"><a class="code" href="../../d0/de1/group__core.html#ga649715908b1dc7fc2496df48dd5fff64">Quatd</a> q(1,2,3,4);</div><div class="line">q.tan();</div></div><!-- fragment --> 
</div>
</div>
<a id="a7f10eb9756915c30697c2536dc9107f8"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a7f10eb9756915c30697c2536dc9107f8">&#9670;&nbsp;</a></span>tanh()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename _Tp&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt;_Tp&gt; <a class="el" href="../../da/d4a/classcv_1_1Quat.html">cv::Quat</a>&lt; _Tp &gt;::tanh </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>return tanh value of this quaternion, tanh could be calculated as: </p><p class="formulaDsp">
\[ \tanh(q) = \frac{\sinh(q)}{\cosh(q)}.\]
</p>
 </p>
<p>For example </p><div class="fragment"><div class="line"><a class="code" href="../../d0/de1/group__core.html#ga649715908b1dc7fc2496df48dd5fff64">Quatd</a> q(1,2,3,4);</div><div class="line">q.tanh();</div></div><!-- fragment --> <dl class="section see"><dt>See also</dt><dd><a class="el" href="../../da/d4a/classcv_1_1Quat.html#a10fa75e217469cba4bac9c7f743e3031" title="return sinh value of quaternion q, sinh could be calculated as:  where  ">sinh</a>, <a class="el" href="../../da/d4a/classcv_1_1Quat.html#a8055944f530299760c54693f172050b4" title="return cosh value of quaternion q, cosh could be calculated as:  where  ">cosh</a> </dd></dl>

</div>
</div>
<a id="ab492aa67bb7803caec230a12c612c4e6"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ab492aa67bb7803caec230a12c612c4e6">&#9670;&nbsp;</a></span>toEulerAngles()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename _Tp&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="../../d6/dcf/classcv_1_1Vec.html">Vec</a>&lt;_Tp, 3&gt; <a class="el" href="../../da/d4a/classcv_1_1Quat.html">cv::Quat</a>&lt; _Tp &gt;::toEulerAngles </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="../../d2/d53/classcv_1_1QuatEnum.html#abceb161bc29a481f2f55439ec723ee45">QuatEnum::EulerAnglesType</a>&#160;</td>
          <td class="paramname"><em>eulerAnglesType</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Transform a quaternion q to Euler angles. </p>
<p>When transforming a quaternion \(q = w + x\boldsymbol{i} + y\boldsymbol{j} + z\boldsymbol{k}\) to Euler angles, rotation matrix M can be calculated by: </p><p class="formulaDsp">
\[ \begin{aligned} {M} &amp;={\begin{bmatrix}1-2(y^{2}+z^{2})&amp;2(xy-zx)&amp;2(xz+yw)\\2(xy+zw)&amp;1-2(x^{2}+z^{2})&amp;2(yz-xw)\\2(xz-yw)&amp;2(yz+xw)&amp;1-2(x^{2}+y^{2})\end{bmatrix}}\end{aligned}.\]
</p>
<p> On the other hand, the rotation matrix can be obtained from Euler angles. Using intrinsic rotations with Euler angles type XYZ as an example, \(\theta_1 \), \(\theta_2 \), \(\theta_3 \) are three angles for Euler angles, the rotation matrix R can be calculated by: </p><p class="formulaDsp">
\[R =X(\theta_1)Y(\theta_2)Z(\theta_3) ={\begin{bmatrix}\cos\theta_{2}\cos\theta_{3}&amp;-\cos\theta_{2}\sin\theta_{3}&amp;\sin\theta_{2}\\\cos\theta_{1}\sin\theta_{3}+\cos\theta_{3}\sin\theta_{1}\sin\theta_{2}&amp;\cos\theta_{1}\cos\theta_{3}-\sin\theta_{1}\sin\theta_{2}\sin\theta_{3}&amp;-\cos\theta_{2}\sin\theta_{1}\\\sin\theta_{1}\sin\theta_{3}-\cos\theta_{1}\cos\theta_{3}\sin\theta_{2}&amp;\cos\theta_{3}\sin\theta_{1}+\cos\theta_{1}\sin\theta_{2}\sin\theta_{3}&amp;\cos\theta_{1}\cos_{2}\end{bmatrix}}\]
</p>
<p> Rotation matrix M and R are equal. As long as \( s_{2} \neq 1 \), by comparing each element of two matrices ,the solution is \(\begin{cases} \theta_1 = \arctan2(-m_{23},m_{33})\\\theta_2 = arcsin(m_{13}) \\\theta_3 = \arctan2(-m_{12},m_{11}) \end{cases}\).</p>
<p>When \( s_{2}=1\) or \( s_{2}=-1\), the gimbal lock occurs. The function will prompt "WARNING: Gimbal Lock will occur. Euler angles is non-unique. For intrinsic rotations, we set the third angle to 0, and for external rotation, we set the first angle to 0.".</p>
<p>When \( s_{2}=1\) , The rotation matrix R is \(R = {\begin{bmatrix}0&amp;0&amp;1\\\sin(\theta_1+\theta_3)&amp;\cos(\theta_1+\theta_3)&amp;0\\-\cos(\theta_1+\theta_3)&amp;\sin(\theta_1+\theta_3)&amp;0\end{bmatrix}}\).</p>
<p>The number of solutions is infinite with the condition \(\begin{cases} \theta_1+\theta_3 = \arctan2(m_{21},m_{22})\\ \theta_2=\pi/2 \end{cases}\ \).</p>
<p>We set \( \theta_3 = 0\), the solution is \(\begin{cases} \theta_1=\arctan2(m_{21},m_{22})\\ \theta_2=\pi/2\\ \theta_3=0 \end{cases}\).</p>
<p>When \( s_{2}=-1\), The rotation matrix R is \(X_{1}Y_{2}Z_{3}={\begin{bmatrix}0&amp;0&amp;-1\\-\sin(\theta_1-\theta_3)&amp;\cos(\theta_1-\theta_3)&amp;0\\\cos(\theta_1-\theta_3)&amp;\sin(\theta_1-\theta_3)&amp;0\end{bmatrix}}\).</p>
<p>The number of solutions is infinite with the condition \(\begin{cases} \theta_1+\theta_3 = \arctan2(m_{32},m_{22})\\ \theta_2=\pi/2 \end{cases}\ \).</p>
<p>We set \( \theta_3 = 0\), the solution is \( \begin{cases}\theta_1=\arctan2(m_{32},m_{22}) \\ \theta_2=-\pi/2\\ \theta_3=0\end{cases}\).</p>
<p>Since \( sin \theta\in [-1,1] \) and \( cos \theta \in [-1,1] \), the unnormalized quaternion will cause computational troubles. For this reason, this function will normalize the quaternion at first and <a class="el" href="../../d0/de1/group__core.html#ga935c8234953e2a2c8557c019ad8d509e">QuatAssumeType</a> is not needed.</p>
<p>When the gimbal lock occurs, we set \(\theta_3 = 0\) for intrinsic rotations or \(\theta_1 = 0\) for extrinsic rotations.</p>
<p>As a result, for every Euler angles type, we can get solution as shown in the following table. </p><table class="doxtable">
<tr>
<th>EulerAnglesType </th><th>Ordinary </th><th>\(\theta_2 = π/2\) </th><th>\(\theta_2 = -π/2\)  </th></tr>
<tr>
<td>INT_XYZ</td><td>\( \theta_1 = \arctan2(-m_{23},m_{33})\\\theta_2 = \arcsin(m_{13}) \\\theta_3= \arctan2(-m_{12},m_{11}) \)</td><td>\( \theta_1=\arctan2(m_{21},m_{22})\\ \theta_2=\pi/2\\ \theta_3=0 \)</td><td>\( \theta_1=\arctan2(m_{32},m_{22})\\ \theta_2=-\pi/2\\ \theta_3=0 \) </td></tr>
<tr>
<td>INT_XZY</td><td>\( \theta_1 = \arctan2(m_{32},m_{22})\\\theta_2 = -\arcsin(m_{12}) \\\theta_3= \arctan2(m_{13},m_{11}) \)</td><td>\( \theta_1=\arctan2(m_{31},m_{33})\\ \theta_2=\pi/2\\ \theta_3=0 \)</td><td>\( \theta_1=\arctan2(-m_{23},m_{33})\\ \theta_2=-\pi/2\\ \theta_3=0 \) </td></tr>
<tr>
<td>INT_YXZ</td><td>\( \theta_1 = \arctan2(m_{13},m_{33})\\\theta_2 = -\arcsin(m_{23}) \\\theta_3= \arctan2(m_{21},m_{22}) \)</td><td>\( \theta_1=\arctan2(m_{12},m_{11})\\ \theta_2=\pi/2\\ \theta_3=0 \)</td><td>\( \theta_1=\arctan2(-m_{12},m_{11})\\ \theta_2=-\pi/2\\ \theta_3=0 \) </td></tr>
<tr>
<td>INT_YZX</td><td>\( \theta_1 = \arctan2(-m_{31},m_{11})\\\theta_2 = \arcsin(m_{21}) \\\theta_3= \arctan2(-m_{23},m_{22}) \)</td><td>\( \theta_1=\arctan2(m_{13},m_{33})\\ \theta_2=\pi/2\\ \theta_3=0 \)</td><td>\( \theta_1=\arctan2(m_{13},m_{12})\\ \theta_2=-\pi/2\\ \theta_3=0 \) </td></tr>
<tr>
<td>INT_ZXY</td><td>\( \theta_1 = \arctan2(-m_{12},m_{22})\\\theta_2 = \arcsin(m_{32}) \\\theta_3= \arctan2(-m_{31},m_{33}) \)</td><td>\( \theta_1=\arctan2(m_{21},m_{11})\\ \theta_2=\pi/2\\ \theta_3=0 \)</td><td>\( \theta_1=\arctan2(m_{21},m_{11})\\ \theta_2=-\pi/2\\ \theta_3=0 \) </td></tr>
<tr>
<td>INT_ZYX</td><td>\( \theta_1 = \arctan2(m_{21},m_{11})\\\theta_2 = \arcsin(-m_{31}) \\\theta_3= \arctan2(m_{32},m_{33}) \)</td><td>\( \theta_1=\arctan2(m_{23},m_{22})\\ \theta_2=\pi/2\\ \theta_3=0 \)</td><td>\( \theta_1=\arctan2(-m_{12},m_{22})\\ \theta_2=-\pi/2\\ \theta_3=0 \) </td></tr>
<tr>
<td>EXT_XYZ</td><td>\( \theta_1 = \arctan2(m_{32},m_{33})\\\theta_2 = \arcsin(-m_{31}) \\\ \theta_3 = \arctan2(m_{21},m_{11})\)</td><td>\( \theta_1= 0\\ \theta_2=\pi/2\\ \theta_3=\arctan2(m_{23},m_{22}) \)</td><td>\( \theta_1=0\\ \theta_2=-\pi/2\\ \theta_3=\arctan2(-m_{12},m_{22}) \) </td></tr>
<tr>
<td>EXT_XZY</td><td>\( \theta_1 = \arctan2(-m_{23},m_{22})\\\theta_2 = \arcsin(m_{21}) \\\theta_3= \arctan2(-m_{31},m_{11})\)</td><td>\( \theta_1= 0\\ \theta_2=\pi/2\\ \theta_3=\arctan2(m_{13},m_{33}) \)</td><td>\( \theta_1=0\\ \theta_2=-\pi/2\\ \theta_3=\arctan2(m_{13},m_{12}) \) </td></tr>
<tr>
<td>EXT_YXZ</td><td>\( \theta_1 = \arctan2(-m_{31},m_{33}) \\\theta_2 = \arcsin(m_{32}) \\\theta_3= \arctan2(-m_{12},m_{22})\)</td><td>\( \theta_1= 0\\ \theta_2=\pi/2\\ \theta_3=\arctan2(m_{21},m_{11}) \)</td><td>\( \theta_1=0\\ \theta_2=-\pi/2\\ \theta_3=\arctan2(m_{21},m_{11}) \) </td></tr>
<tr>
<td>EXT_YZX</td><td>\( \theta_1 = \arctan2(m_{13},m_{11})\\\theta_2 = -\arcsin(m_{12}) \\\theta_3= \arctan2(m_{32},m_{22})\)</td><td>\( \theta_1= 0\\ \theta_2=\pi/2\\ \theta_3=\arctan2(m_{31},m_{33}) \)</td><td>\( \theta_1=0\\ \theta_2=-\pi/2\\ \theta_3=\arctan2(-m_{23},m_{33}) \) </td></tr>
<tr>
<td>EXT_ZXY</td><td>\( \theta_1 = \arctan2(m_{21},m_{22})\\\theta_2 = -\arcsin(m_{23}) \\\theta_3= \arctan2(m_{13},m_{33})\)</td><td>\( \theta_1= 0\\ \theta_2=\pi/2\\ \theta_3=\arctan2(m_{12},m_{11}) \)</td><td>\( \theta_1= 0\\ \theta_2=-\pi/2\\ \theta_3=\arctan2(-m_{12},m_{11}) \) </td></tr>
<tr>
<td>EXT_ZYX</td><td>\( \theta_1 = \arctan2(-m_{12},m_{11})\\\theta_2 = \arcsin(m_{13}) \\\theta_3= \arctan2(-m_{23},m_{33})\)</td><td>\( \theta_1=0\\ \theta_2=\pi/2\\ \theta_3=\arctan2(m_{21},m_{22}) \)</td><td>\( \theta_1=0\\ \theta_2=-\pi/2\\ \theta_3=\arctan2(m_{32},m_{22}) \) </td></tr>
</table>
<table class="doxtable">
<tr>
<th>EulerAnglesType </th><th>Ordinary </th><th>\(\theta_2 = 0\) </th><th>\(\theta_2 = π\)  </th></tr>
<tr>
<td>INT_XYX</td><td>\( \theta_1 = \arctan2(m_{21},-m_{31})\\\theta_2 =\arccos(m_{11}) \\\theta_3 = \arctan2(m_{12},m_{13}) \)</td><td>\( \theta_1=\arctan2(m_{32},m_{33})\\ \theta_2=0\\ \theta_3=0 \)</td><td>\( \theta_1=\arctan2(m_{23},m_{22})\\ \theta_2=\pi\\ \theta_3=0 \) </td></tr>
<tr>
<td>INT_XZX</td><td>\( \theta_1 = \arctan2(m_{31},m_{21})\\\theta_2 = \arccos(m_{11}) \\\theta_3 = \arctan2(m_{13},-m_{12}) \)</td><td>\( \theta_1=\arctan2(m_{32},m_{33})\\ \theta_2=0\\ \theta_3=0 \)</td><td>\( \theta_1=\arctan2(-m_{32},m_{33})\\ \theta_2=\pi\\ \theta_3=0 \) </td></tr>
<tr>
<td>INT_YXY</td><td>\( \theta_1 = \arctan2(m_{12},m_{32})\\\theta_2 = \arccos(m_{22}) \\\theta_3 = \arctan2(m_{21},-m_{23}) \)</td><td>\( \theta_1=\arctan2(m_{13},m_{11})\\ \theta_2=0\\ \theta_3=0 \)</td><td>\( \theta_1=\arctan2(-m_{31},m_{11})\\ \theta_2=\pi\\ \theta_3=0 \) </td></tr>
<tr>
<td>INT_YZY</td><td>\( \theta_1 = \arctan2(m_{32},-m_{12})\\\theta_2 = \arccos(m_{22}) \\\theta_3 =\arctan2(m_{23},m_{21}) \)</td><td>\( \theta_1=\arctan2(m_{13},m_{11})\\ \theta_2=0\\ \theta_3=0 \)</td><td>\( \theta_1=\arctan2(m_{13},-m_{11})\\ \theta_2=\pi\\ \theta_3=0 \) </td></tr>
<tr>
<td>INT_ZXZ</td><td>\( \theta_1 = \arctan2(-m_{13},m_{23})\\\theta_2 = \arccos(m_{33}) \\\theta_3 =\arctan2(m_{31},m_{32}) \)</td><td>\( \theta_1=\arctan2(m_{21},m_{22})\\ \theta_2=0\\ \theta_3=0 \)</td><td>\( \theta_1=\arctan2(m_{21},m_{11})\\ \theta_2=\pi\\ \theta_3=0 \) </td></tr>
<tr>
<td>INT_ZYZ</td><td>\( \theta_1 = \arctan2(m_{23},m_{13})\\\theta_2 = \arccos(m_{33}) \\\theta_3 = \arctan2(m_{32},-m_{31}) \)</td><td>\( \theta_1=\arctan2(m_{21},m_{11})\\ \theta_2=0\\ \theta_3=0 \)</td><td>\( \theta_1=\arctan2(m_{21},m_{11})\\ \theta_2=\pi\\ \theta_3=0 \) </td></tr>
<tr>
<td>EXT_XYX</td><td>\( \theta_1 = \arctan2(m_{12},m_{13}) \\\theta_2 = \arccos(m_{11}) \\\theta_3 = \arctan2(m_{21},-m_{31})\)</td><td>\( \theta_1=0\\ \theta_2=0\\ \theta_3=\arctan2(m_{32},m_{33}) \)</td><td>\( \theta_1= 0\\ \theta_2=\pi\\ \theta_3= \arctan2(m_{23},m_{22}) \) </td></tr>
<tr>
<td>EXT_XZX</td><td>\( \theta_1 = \arctan2(m_{13},-m_{12})\\\theta_2 = \arccos(m_{11}) \\\theta_3 = \arctan2(m_{31},m_{21})\)</td><td>\( \theta_1= 0\\ \theta_2=0\\ \theta_3=\arctan2(m_{32},m_{33}) \)</td><td>\( \theta_1= 0\\ \theta_2=\pi\\ \theta_3=\arctan2(-m_{32},m_{33}) \) </td></tr>
<tr>
<td>EXT_YXY</td><td>\( \theta_1 = \arctan2(m_{21},-m_{23})\\\theta_2 = \arccos(m_{22}) \\\theta_3 = \arctan2(m_{12},m_{32}) \)</td><td>\( \theta_1= 0\\ \theta_2=0\\ \theta_3=\arctan2(m_{13},m_{11}) \)</td><td>\( \theta_1= 0\\ \theta_2=\pi\\ \theta_3=\arctan2(-m_{31},m_{11}) \) </td></tr>
<tr>
<td>EXT_YZY</td><td>\( \theta_1 = \arctan2(m_{23},m_{21}) \\\theta_2 = \arccos(m_{22}) \\\theta_3 = \arctan2(m_{32},-m_{12}) \)</td><td>\( \theta_1= 0\\ \theta_2=0\\ \theta_3=\arctan2(m_{13},m_{11}) \)</td><td>\( \theta_1=0\\ \theta_2=\pi\\ \theta_3=\arctan2(m_{13},-m_{11}) \) </td></tr>
<tr>
<td>EXT_ZXZ</td><td>\( \theta_1 = \arctan2(m_{31},m_{32}) \\\theta_2 = \arccos(m_{33}) \\\theta_3 = \arctan2(-m_{13},m_{23})\)</td><td>\( \theta_1=0\\ \theta_2=0\\ \theta_3=\arctan2(m_{21},m_{22}) \)</td><td>\( \theta_1= 0\\ \theta_2=\pi\\ \theta_3=\arctan2(m_{21},m_{11}) \) </td></tr>
<tr>
<td>EXT_ZYZ</td><td>\( \theta_1 = \arctan2(m_{32},-m_{31})\\\theta_2 = \arccos(m_{33}) \\\theta_3 = \arctan2(m_{23},m_{13}) \)</td><td>\( \theta_1=0\\ \theta_2=0\\ \theta_3=\arctan2(m_{21},m_{11}) \)</td><td>\( \theta_1= 0\\ \theta_2=\pi\\ \theta_3=\arctan2(m_{21},m_{11}) \) </td></tr>
</table>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">eulerAnglesType</td><td>the convertion Euler angles type </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="a3d7acac76ca39522aaa3df9cd45ee1cf"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a3d7acac76ca39522aaa3df9cd45ee1cf">&#9670;&nbsp;</a></span>toRotMat3x3()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename _Tp&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="../../de/de1/classcv_1_1Matx.html">Matx</a>&lt;_Tp, 3, 3&gt; <a class="el" href="../../da/d4a/classcv_1_1Quat.html">cv::Quat</a>&lt; _Tp &gt;::toRotMat3x3 </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="../../d0/de1/group__core.html#ga935c8234953e2a2c8557c019ad8d509e">QuatAssumeType</a>&#160;</td>
          <td class="paramname"><em>assumeUnit</em> = <code><a class="el" href="../../d0/de1/group__core.html#gga935c8234953e2a2c8557c019ad8d509ea786f758552bf7be9ee5f12ca2157cf8f">QUAT_ASSUME_NOT_UNIT</a></code></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>transform a quaternion to a 3x3 rotation matrix. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">assumeUnit</td><td>if QUAT_ASSUME_UNIT, this quaternion assume to be a unit quaternion and this function will save some computations. Otherwise, this function will normalize this quaternion at first then do the transformation.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section note"><dt>Note</dt><dd>Matrix A which is to be rotated should have the form <p class="formulaDsp">
\[\begin{bmatrix} x_0&amp; x_1&amp; x_2&amp;...&amp;x_n\\ y_0&amp; y_1&amp; y_2&amp;...&amp;y_n\\ z_0&amp; z_1&amp; z_2&amp;...&amp;z_n \end{bmatrix}\]
</p>
 where the same subscript represents a point. The shape of A assume to be [3, n] The points matrix A can be rotated by <a class="el" href="../../da/d4a/classcv_1_1Quat.html#a3d7acac76ca39522aaa3df9cd45ee1cf" title="transform a quaternion to a 3x3 rotation matrix. ">toRotMat3x3()</a> * A. The result has 3 rows and n columns too.</dd></dl>
<p>For example </p><div class="fragment"><div class="line"><span class="keywordtype">double</span> angle = <a class="code" href="../../db/de0/group__core__utils.html#ga677b89fae9308b340ddaebf0dba8455f">CV_PI</a>;</div><div class="line"><a class="code" href="../../dc/d84/group__core__basic.html#ga370d94209693b5b13437ab4991cabf73">Vec3d</a> axis{0,0,1};</div><div class="line"><a class="code" href="../../d0/de1/group__core.html#ga649715908b1dc7fc2496df48dd5fff64">Quatd</a> q_unit = <a class="code" href="../../da/d4a/classcv_1_1Quat.html#ab9b2bcb68e895895e61c826223e1ab55">Quatd::createFromAngleAxis</a>(angle, axis); <span class="comment">//quaternion could also be get by interpolation by two or more quaternions.</span></div><div class="line"></div><div class="line"><span class="comment">//assume there is two points (1,0,0) and (1,0,1) to be rotated</span></div><div class="line">Mat pointsA = (Mat_&lt;double&gt;(2, 3) &lt;&lt; 1,0,0,1,0,1);</div><div class="line"><span class="comment">//change the shape</span></div><div class="line">pointsA = pointsA.t();</div><div class="line"><span class="comment">// rotate 180 degrees around the z axis</span></div><div class="line">Mat new_point = q_unit.toRotMat3x3() * pointsA;</div><div class="line"><span class="comment">// print two points</span></div><div class="line">cout &lt;&lt; new_point &lt;&lt; endl;</div></div><!-- fragment --> 
</div>
</div>
<a id="a8020a28df9d895b4d4263d827aa9eea2"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a8020a28df9d895b4d4263d827aa9eea2">&#9670;&nbsp;</a></span>toRotMat4x4()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename _Tp&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="../../de/de1/classcv_1_1Matx.html">Matx</a>&lt;_Tp, 4, 4&gt; <a class="el" href="../../da/d4a/classcv_1_1Quat.html">cv::Quat</a>&lt; _Tp &gt;::toRotMat4x4 </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="../../d0/de1/group__core.html#ga935c8234953e2a2c8557c019ad8d509e">QuatAssumeType</a>&#160;</td>
          <td class="paramname"><em>assumeUnit</em> = <code><a class="el" href="../../d0/de1/group__core.html#gga935c8234953e2a2c8557c019ad8d509ea786f758552bf7be9ee5f12ca2157cf8f">QUAT_ASSUME_NOT_UNIT</a></code></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>transform a quaternion to a 4x4 rotation matrix. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">assumeUnit</td><td>if QUAT_ASSUME_UNIT, this quaternion assume to be a unit quaternion and this function will save some computations. Otherwise, this function will normalize this quaternion at first then do the transformation.</td></tr>
  </table>
  </dd>
</dl>
<p>The operations is similar as toRotMat3x3 except that the points matrix should have the form </p><p class="formulaDsp">
\[\begin{bmatrix} x_0&amp; x_1&amp; x_2&amp;...&amp;x_n\\ y_0&amp; y_1&amp; y_2&amp;...&amp;y_n\\ z_0&amp; z_1&amp; z_2&amp;...&amp;z_n\\ 0&amp;0&amp;0&amp;...&amp;0 \end{bmatrix}\]
</p>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="../../da/d4a/classcv_1_1Quat.html#a3d7acac76ca39522aaa3df9cd45ee1cf" title="transform a quaternion to a 3x3 rotation matrix. ">toRotMat3x3</a> </dd></dl>

</div>
</div>
<a id="ae4f521aba52df53f7484655dba8075de"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ae4f521aba52df53f7484655dba8075de">&#9670;&nbsp;</a></span>toRotVec()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename _Tp&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="../../d6/dcf/classcv_1_1Vec.html">Vec</a>&lt;_Tp, 3&gt; <a class="el" href="../../da/d4a/classcv_1_1Quat.html">cv::Quat</a>&lt; _Tp &gt;::toRotVec </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="../../d0/de1/group__core.html#ga935c8234953e2a2c8557c019ad8d509e">QuatAssumeType</a>&#160;</td>
          <td class="paramname"><em>assumeUnit</em> = <code><a class="el" href="../../d0/de1/group__core.html#gga935c8234953e2a2c8557c019ad8d509ea786f758552bf7be9ee5f12ca2157cf8f">QUAT_ASSUME_NOT_UNIT</a></code></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>transform this quaternion to a Rotation vector. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">assumeUnit</td><td>if QUAT_ASSUME_UNIT, this quaternion assume to be a unit quaternion and this function will save some computations. Rotation vector rVec is defined as: <p class="formulaDsp">
\[ rVec = [\theta v_x, \theta v_y, \theta v_z]\]
</p>
 where \(\theta\) represents rotation angle, and \(\boldsymbol{v}\) represents the normalized rotation axis.</td></tr>
  </table>
  </dd>
</dl>
<p>For example </p><div class="fragment"><div class="line"><a class="code" href="../../d0/de1/group__core.html#ga649715908b1dc7fc2496df48dd5fff64">Quatd</a> q(1,2,3,4);</div><div class="line">q.toRotVec();</div><div class="line"></div><div class="line"><a class="code" href="../../d0/de1/group__core.html#ga935c8234953e2a2c8557c019ad8d509e">QuatAssumeType</a> assumeUnit = <a class="code" href="../../d0/de1/group__core.html#gga935c8234953e2a2c8557c019ad8d509ea87af033c2248f7a0b4548ffa56afc697">QUAT_ASSUME_UNIT</a>;</div><div class="line">q.normalize().toRotVec(assumeUnit); <span class="comment">//answer is same as q.toRotVec().</span></div></div><!-- fragment --> 
</div>
</div>
<a id="ab22aeadc6a73208bb62570ccf631c02d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ab22aeadc6a73208bb62570ccf631c02d">&#9670;&nbsp;</a></span>toVec()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename _Tp&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="../../d6/dcf/classcv_1_1Vec.html">Vec</a>&lt;_Tp, 4&gt; <a class="el" href="../../da/d4a/classcv_1_1Quat.html">cv::Quat</a>&lt; _Tp &gt;::toVec </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>transform the this quaternion to a Vec&lt;T, 4&gt;. </p>
<p>For example </p><div class="fragment"><div class="line"><a class="code" href="../../d0/de1/group__core.html#ga649715908b1dc7fc2496df48dd5fff64">Quatd</a> q(1,2,3,4);</div><div class="line">q.toVec();</div></div><!-- fragment --> 
</div>
</div>
<h2 class="groupheader">Friends And Related Function Documentation</h2>
<a id="afdcc13d7f08a0375079d5f2ca32ead73"></a>
<h2 class="memtitle"><span class="permalink"><a href="#afdcc13d7f08a0375079d5f2ca32ead73">&#9670;&nbsp;</a></span>acos</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename _Tp&gt; </div>
<div class="memtemplate">
template&lt;typename T &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt;T&gt; acos </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt; T &gt; &amp;&#160;</td>
          <td class="paramname"><em>q</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">friend</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>return arccos value of quaternion q, arccos could be calculated as: </p><p class="formulaDsp">
\[\arccos(q) = -\frac{\boldsymbol{v}}{||\boldsymbol{v}||}arccosh(q)\]
</p>
<p> where \(\boldsymbol{v} = [x, y, z].\) </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">q</td><td>a quaternion.</td></tr>
  </table>
  </dd>
</dl>
<p>For example </p><div class="fragment"><div class="line"><a class="code" href="../../d0/de1/group__core.html#ga649715908b1dc7fc2496df48dd5fff64">Quatd</a> q(1,2,3,4);</div><div class="line"><a class="code" href="../../da/d4a/classcv_1_1Quat.html#a5125ead334093d651bf3ce982490007b">acos</a>(q);</div></div><!-- fragment --> 
</div>
</div>
<a id="a2ed2761540634dd41c532b7c75f2d8e6"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a2ed2761540634dd41c532b7c75f2d8e6">&#9670;&nbsp;</a></span>acosh</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename _Tp&gt; </div>
<div class="memtemplate">
template&lt;typename T &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt;T&gt; acosh </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt; T &gt; &amp;&#160;</td>
          <td class="paramname"><em>q</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">friend</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>return arccosh value of quaternion q, arccosh could be calculated as: </p><p class="formulaDsp">
\[arccosh(q) = \ln(q + \sqrt{q^2 - 1})\]
</p>
<p>. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">q</td><td>a quaternion.</td></tr>
  </table>
  </dd>
</dl>
<p>For example </p><div class="fragment"><div class="line"><a class="code" href="../../d0/de1/group__core.html#ga649715908b1dc7fc2496df48dd5fff64">Quatd</a> q(1,2,3,4);</div><div class="line"><a class="code" href="../../da/d4a/classcv_1_1Quat.html#a67afde4bb8288c5ae606d3aae5b7bb8b">acosh</a>(q);</div></div><!-- fragment --> 
</div>
</div>
<a id="a78176c2913c20f7e99c00c781a98f699"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a78176c2913c20f7e99c00c781a98f699">&#9670;&nbsp;</a></span>asin</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename _Tp&gt; </div>
<div class="memtemplate">
template&lt;typename T &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt;T&gt; asin </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt; T &gt; &amp;&#160;</td>
          <td class="paramname"><em>q</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">friend</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>return arcsin value of quaternion q, arcsin could be calculated as: </p><p class="formulaDsp">
\[\arcsin(q) = -\frac{\boldsymbol{v}}{||\boldsymbol{v}||}arcsinh(q\frac{\boldsymbol{v}}{||\boldsymbol{v}||})\]
</p>
<p> where \(\boldsymbol{v} = [x, y, z].\) </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">q</td><td>a quaternion.</td></tr>
  </table>
  </dd>
</dl>
<p>For example </p><div class="fragment"><div class="line"><a class="code" href="../../d0/de1/group__core.html#ga649715908b1dc7fc2496df48dd5fff64">Quatd</a> q(1,2,3,4);</div><div class="line"><a class="code" href="../../da/d4a/classcv_1_1Quat.html#aa084d62b9e250dffe63b2c940a904765">asin</a>(q);</div></div><!-- fragment --> 
</div>
</div>
<a id="a018058ca2be87fe61f8b26a594c99927"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a018058ca2be87fe61f8b26a594c99927">&#9670;&nbsp;</a></span>asinh</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename _Tp&gt; </div>
<div class="memtemplate">
template&lt;typename T &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt;T&gt; asinh </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt; T &gt; &amp;&#160;</td>
          <td class="paramname"><em>q</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">friend</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>return arcsinh value of quaternion q, arcsinh could be calculated as: </p><p class="formulaDsp">
\[arcsinh(q) = \ln(q + \sqrt{q^2 + 1})\]
</p>
<p>. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">q</td><td>a quaternion.</td></tr>
  </table>
  </dd>
</dl>
<p>For example </p><div class="fragment"><div class="line"><a class="code" href="../../d0/de1/group__core.html#ga649715908b1dc7fc2496df48dd5fff64">Quatd</a> q(1,2,3,4);</div><div class="line"><a class="code" href="../../da/d4a/classcv_1_1Quat.html#a12e169c174809e62abbc16dd1bd63a05">asinh</a>(q);</div></div><!-- fragment --> 
</div>
</div>
<a id="a17635e02afde2c6883444f2e40322535"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a17635e02afde2c6883444f2e40322535">&#9670;&nbsp;</a></span>atan</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename _Tp&gt; </div>
<div class="memtemplate">
template&lt;typename T &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt;T&gt; atan </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt; T &gt; &amp;&#160;</td>
          <td class="paramname"><em>q</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">friend</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>return arctan value of quaternion q, arctan could be calculated as: </p><p class="formulaDsp">
\[\arctan(q) = -\frac{\boldsymbol{v}}{||\boldsymbol{v}||}arctanh(q\frac{\boldsymbol{v}}{||\boldsymbol{v}||})\]
</p>
<p> where \(\boldsymbol{v} = [x, y, z].\) </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">q</td><td>a quaternion.</td></tr>
  </table>
  </dd>
</dl>
<p>For example </p><div class="fragment"><div class="line"><a class="code" href="../../d0/de1/group__core.html#ga649715908b1dc7fc2496df48dd5fff64">Quatd</a> q(1,2,3,4);</div><div class="line"><a class="code" href="../../da/d4a/classcv_1_1Quat.html#ac9f4087dd676854b97f5a8ce63beaa62">atan</a>(q);</div></div><!-- fragment --> 
</div>
</div>
<a id="af2f8b47671a49d7d745edb95e6199b4a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#af2f8b47671a49d7d745edb95e6199b4a">&#9670;&nbsp;</a></span>atanh</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename _Tp&gt; </div>
<div class="memtemplate">
template&lt;typename T &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt;T&gt; atanh </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt; T &gt; &amp;&#160;</td>
          <td class="paramname"><em>q</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">friend</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>return arctanh value of quaternion q, arctanh could be calculated as: </p><p class="formulaDsp">
\[arctanh(q) = \frac{\ln(q + 1) - \ln(1 - q)}{2}\]
</p>
<p>. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">q</td><td>a quaternion.</td></tr>
  </table>
  </dd>
</dl>
<p>For example </p><div class="fragment"><div class="line"><a class="code" href="../../d0/de1/group__core.html#ga649715908b1dc7fc2496df48dd5fff64">Quatd</a> q(1,2,3,4);</div><div class="line"><a class="code" href="../../da/d4a/classcv_1_1Quat.html#ad818d4a92c0093fd75a7b2750b17a89a">atanh</a>(q);</div></div><!-- fragment --> 
</div>
</div>
<a id="a556bb2fc6694c529a6d749b91da5d024"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a556bb2fc6694c529a6d749b91da5d024">&#9670;&nbsp;</a></span>cos</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename _Tp&gt; </div>
<div class="memtemplate">
template&lt;typename T &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt;T&gt; cos </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt; T &gt; &amp;&#160;</td>
          <td class="paramname"><em>q</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">friend</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>return sin value of quaternion q, cos could be calculated as: </p><p class="formulaDsp">
\[\cos(p) = \cos(w) * \cosh(||\boldsymbol{v}||) - \sin(w)\frac{\boldsymbol{v}}{||\boldsymbol{v}||}\sinh(||\boldsymbol{v}||)\]
</p>
<p> where \(\boldsymbol{v} = [x, y, z].\) </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">q</td><td>a quaternion.</td></tr>
  </table>
  </dd>
</dl>
<p>For example </p><div class="fragment"><div class="line"><a class="code" href="../../d0/de1/group__core.html#ga649715908b1dc7fc2496df48dd5fff64">Quatd</a> q(1,2,3,4);</div><div class="line"><a class="code" href="../../da/d4a/classcv_1_1Quat.html#a20cf4c9219906bae81210fd8dc01e176">cos</a>(q);</div></div><!-- fragment --> 
</div>
</div>
<a id="a8055944f530299760c54693f172050b4"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a8055944f530299760c54693f172050b4">&#9670;&nbsp;</a></span>cosh</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename _Tp&gt; </div>
<div class="memtemplate">
template&lt;typename T &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt;T&gt; cosh </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt; T &gt; &amp;&#160;</td>
          <td class="paramname"><em>q</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">friend</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>return cosh value of quaternion q, cosh could be calculated as: </p><p class="formulaDsp">
\[\cosh(p) = \cosh(w) * \cos(||\boldsymbol{v}||) + \sinh(w)\frac{\boldsymbol{v}}{||\boldsymbol{v}||}\sin(||\boldsymbol{v}||)\]
</p>
<p> where \(\boldsymbol{v} = [x, y, z].\) </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">q</td><td>a quaternion.</td></tr>
  </table>
  </dd>
</dl>
<p>For example </p><div class="fragment"><div class="line"><a class="code" href="../../d0/de1/group__core.html#ga649715908b1dc7fc2496df48dd5fff64">Quatd</a> q(1,2,3,4);</div><div class="line"><a class="code" href="../../da/d4a/classcv_1_1Quat.html#ac18ecd261065fa7546bedc9e937121b8">cosh</a>(q);</div></div><!-- fragment --> 
</div>
</div>
<a id="a0d5d34fca2651a3c443d10a7d3afcee1"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a0d5d34fca2651a3c443d10a7d3afcee1">&#9670;&nbsp;</a></span>crossProduct</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename _Tp&gt; </div>
<div class="memtemplate">
template&lt;typename T &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt;T&gt; crossProduct </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt; T &gt; &amp;&#160;</td>
          <td class="paramname"><em>p</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt; T &gt; &amp;&#160;</td>
          <td class="paramname"><em>q</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">friend</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>return the crossProduct between \(p = (a, b, c, d) = (a, \boldsymbol{u})\) and \(q = (w, x, y, z) = (w, \boldsymbol{v})\). </p><p class="formulaDsp">
\[p \times q = \frac{pq- qp}{2}\]
</p>
 <p class="formulaDsp">
\[p \times q = \boldsymbol{u} \times \boldsymbol{v}\]
</p>
 <p class="formulaDsp">
\[p \times q = (cz-dy)i + (dx-bz)j + (by-xc)k \]
</p>
 </p>
<p>For example </p><div class="fragment"><div class="line"><a class="code" href="../../d0/de1/group__core.html#ga649715908b1dc7fc2496df48dd5fff64">Quatd</a> q{1,2,3,4};</div><div class="line"><a class="code" href="../../d0/de1/group__core.html#ga649715908b1dc7fc2496df48dd5fff64">Quatd</a> p{5,6,7,8};</div><div class="line"><a class="code" href="../../da/d4a/classcv_1_1Quat.html#a0d5d34fca2651a3c443d10a7d3afcee1">crossProduct</a>(p, q);</div></div><!-- fragment --> 
</div>
</div>
<a id="adb8e5d622ca910b60820ecefdc42fe5f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#adb8e5d622ca910b60820ecefdc42fe5f">&#9670;&nbsp;</a></span>cv::operator* <span class="overload">[1/2]</span></h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename _Tp&gt; </div>
<div class="memtemplate">
template&lt;typename T &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt;T&gt; cv::operator* </td>
          <td>(</td>
          <td class="paramtype">const T&#160;</td>
          <td class="paramname"><em>s</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt; T &gt; &amp;&#160;</td>
          <td class="paramname">&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">friend</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Multiplication operator of a scalar and a quaternions. It multiplies right operand with the left operand and assign the result to left operand. </p>
<p>Rule of quaternion multiplication with a scalar: </p><p class="formulaDsp">
\[ \begin{equation} \begin{split} p * s &amp;= [w, x, y, z] * s\\ &amp;=[w * s, x * s, y * s, z * s]. \end{split} \end{equation} \]
</p>
<p>For example </p><div class="fragment"><div class="line"><a class="code" href="../../d0/de1/group__core.html#ga649715908b1dc7fc2496df48dd5fff64">Quatd</a> p{1, 2, 3, 4};</div><div class="line"><span class="keywordtype">double</span> s = 2.0;</div><div class="line">std::cout &lt;&lt; s * p &lt;&lt; std::endl; <span class="comment">//[2.0, 4.0, 6.0, 8.0]</span></div></div><!-- fragment --> <dl class="section note"><dt>Note</dt><dd>the type of scalar should be equal to the quaternion. </dd></dl>

</div>
</div>
<a id="a2d45057d85114709c2e87881119c770c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a2d45057d85114709c2e87881119c770c">&#9670;&nbsp;</a></span>cv::operator* <span class="overload">[2/2]</span></h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename _Tp&gt; </div>
<div class="memtemplate">
template&lt;typename T &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt;T&gt; cv::operator* </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt; T &gt; &amp;&#160;</td>
          <td class="paramname">, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const T&#160;</td>
          <td class="paramname"><em>s</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">friend</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Multiplication operator of a quaternion and a scalar. It multiplies right operand with the left operand and assign the result to left operand. </p>
<p>Rule of quaternion multiplication with a scalar: </p><p class="formulaDsp">
\[ \begin{equation} \begin{split} p * s &amp;= [w, x, y, z] * s\\ &amp;=[w * s, x * s, y * s, z * s]. \end{split} \end{equation} \]
</p>
<p>For example </p><div class="fragment"><div class="line"><a class="code" href="../../d0/de1/group__core.html#ga649715908b1dc7fc2496df48dd5fff64">Quatd</a> p{1, 2, 3, 4};</div><div class="line"><span class="keywordtype">double</span> s = 2.0;</div><div class="line">std::cout &lt;&lt; p * s &lt;&lt; std::endl; <span class="comment">//[2.0, 4.0, 6.0, 8.0]</span></div></div><!-- fragment --> <dl class="section note"><dt>Note</dt><dd>the type of scalar should be equal to the quaternion. </dd></dl>

</div>
</div>
<a id="ac7dbced91b124a20abd408d4f4c4e599"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac7dbced91b124a20abd408d4f4c4e599">&#9670;&nbsp;</a></span>cv::operator+ <span class="overload">[1/2]</span></h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename _Tp&gt; </div>
<div class="memtemplate">
template&lt;typename T &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt;T&gt; cv::operator+ </td>
          <td>(</td>
          <td class="paramtype">const T&#160;</td>
          <td class="paramname"><em>s</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt; T &gt; &amp;&#160;</td>
          <td class="paramname">&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">friend</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Addition operator of a quaternions and a scalar. Adds right hand operand from left hand operand. </p>
<p>For example </p><div class="fragment"><div class="line"><a class="code" href="../../d0/de1/group__core.html#ga649715908b1dc7fc2496df48dd5fff64">Quatd</a> p{1, 2, 3, 4};</div><div class="line"><span class="keywordtype">double</span> scalar = 2.0;</div><div class="line">std::cout &lt;&lt; scalar + p &lt;&lt; std::endl; <span class="comment">//[3.0, 2, 3, 4]</span></div></div><!-- fragment --> <dl class="section note"><dt>Note</dt><dd>the type of scalar should be equal to the quaternion. </dd></dl>

</div>
</div>
<a id="a63135c782c2911cce4b7a71749c913ec"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a63135c782c2911cce4b7a71749c913ec">&#9670;&nbsp;</a></span>cv::operator+ <span class="overload">[2/2]</span></h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename _Tp&gt; </div>
<div class="memtemplate">
template&lt;typename T &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt;T&gt; cv::operator+ </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt; T &gt; &amp;&#160;</td>
          <td class="paramname">, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const T&#160;</td>
          <td class="paramname"><em>s</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">friend</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Addition operator of a quaternions and a scalar. Adds right hand operand from left hand operand. </p>
<p>For example </p><div class="fragment"><div class="line"><a class="code" href="../../d0/de1/group__core.html#ga649715908b1dc7fc2496df48dd5fff64">Quatd</a> p{1, 2, 3, 4};</div><div class="line"><span class="keywordtype">double</span> scalar = 2.0;</div><div class="line">std::cout &lt;&lt; p + scalar &lt;&lt; std::endl; <span class="comment">//[3.0, 2, 3, 4]</span></div></div><!-- fragment --> <dl class="section note"><dt>Note</dt><dd>the type of scalar should be equal to the quaternion. </dd></dl>

</div>
</div>
<a id="ab8a8810efeacf0f99844831194c0692c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ab8a8810efeacf0f99844831194c0692c">&#9670;&nbsp;</a></span>cv::operator- <span class="overload">[1/2]</span></h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename _Tp&gt; </div>
<div class="memtemplate">
template&lt;typename T &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt;T&gt; cv::operator- </td>
          <td>(</td>
          <td class="paramtype">const T&#160;</td>
          <td class="paramname"><em>s</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt; T &gt; &amp;&#160;</td>
          <td class="paramname">&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">friend</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Subtraction operator of a scalar and a quaternions. Subtracts right hand operand from left hand operand. </p>
<p>For example </p><div class="fragment"><div class="line"><a class="code" href="../../d0/de1/group__core.html#ga649715908b1dc7fc2496df48dd5fff64">Quatd</a> p{1, 2, 3, 4};</div><div class="line"><span class="keywordtype">double</span> scalar = 2.0;</div><div class="line">std::cout &lt;&lt; scalar - p &lt;&lt; std::endl; <span class="comment">//[1.0, -2, -3, -4]</span></div></div><!-- fragment --> <dl class="section note"><dt>Note</dt><dd>the type of scalar should be equal to the quaternion. </dd></dl>

</div>
</div>
<a id="a8e34d79198147bf83c61d0aebed4d46c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a8e34d79198147bf83c61d0aebed4d46c">&#9670;&nbsp;</a></span>cv::operator- <span class="overload">[2/2]</span></h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename _Tp&gt; </div>
<div class="memtemplate">
template&lt;typename T &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt;T&gt; cv::operator- </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt; T &gt; &amp;&#160;</td>
          <td class="paramname">, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const T&#160;</td>
          <td class="paramname"><em>s</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">friend</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Subtraction operator of a quaternions and a scalar. Subtracts right hand operand from left hand operand. </p>
<p>For example </p><div class="fragment"><div class="line"><a class="code" href="../../d0/de1/group__core.html#ga649715908b1dc7fc2496df48dd5fff64">Quatd</a> p{1, 2, 3, 4};</div><div class="line"><span class="keywordtype">double</span> scalar = 2.0;</div><div class="line">std::cout &lt;&lt; p - scalar &lt;&lt; std::endl; <span class="comment">//[-1.0, 2, 3, 4]</span></div></div><!-- fragment --> <dl class="section note"><dt>Note</dt><dd>the type of scalar should be equal to the quaternion. </dd></dl>

</div>
</div>
<a id="a2de95d4627012f18f144e427e33dba35"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a2de95d4627012f18f144e427e33dba35">&#9670;&nbsp;</a></span>cv::operator<<</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename _Tp&gt; </div>
<div class="memtemplate">
template&lt;typename S &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">std::ostream&amp; cv::operator&lt;&lt; </td>
          <td>(</td>
          <td class="paramtype">std::ostream &amp;&#160;</td>
          <td class="paramname">, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt; S &gt; &amp;&#160;</td>
          <td class="paramname">&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">friend</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

</div>
</div>
<a id="a92e30501fcb79c29c8877709b55d612d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a92e30501fcb79c29c8877709b55d612d">&#9670;&nbsp;</a></span>exp</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename _Tp&gt; </div>
<div class="memtemplate">
template&lt;typename T &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt;T&gt; exp </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt; T &gt; &amp;&#160;</td>
          <td class="paramname"><em>q</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">friend</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>return the value of exponential value. </p><p class="formulaDsp">
\[\exp(q) = e^w (\cos||\boldsymbol{v}||+ \frac{v}{||\boldsymbol{v}||})\sin||\boldsymbol{v}||\]
</p>
<p> where \(\boldsymbol{v} = [x, y, z].\) </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">q</td><td>a quaternion.</td></tr>
  </table>
  </dd>
</dl>
<p>For example: </p><div class="fragment"><div class="line"><a class="code" href="../../d0/de1/group__core.html#ga649715908b1dc7fc2496df48dd5fff64">Quatd</a> q{1,2,3,4};</div><div class="line">cout &lt;&lt; <a class="code" href="../../da/d4a/classcv_1_1Quat.html#acb646a572c605b3ea5d5b08bb2fb3aa1">exp</a>(q) &lt;&lt; endl;</div></div><!-- fragment --> 
</div>
</div>
<a id="ab25ed7498bc5db29de2db5b5378f981c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ab25ed7498bc5db29de2db5b5378f981c">&#9670;&nbsp;</a></span>inv</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename _Tp&gt; </div>
<div class="memtemplate">
template&lt;typename T &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt;T&gt; inv </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt; T &gt; &amp;&#160;</td>
          <td class="paramname"><em>q</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../d0/de1/group__core.html#ga935c8234953e2a2c8557c019ad8d509e">QuatAssumeType</a>&#160;</td>
          <td class="paramname"><em>assumeUnit</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">friend</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>return \(q^{-1}\) which is an inverse of \(q\) which satisfies \(q * q^{-1} = 1\). </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">q</td><td>a quaternion. </td></tr>
    <tr><td class="paramname">assumeUnit</td><td>if QUAT_ASSUME_UNIT, quaternion q assume to be a unit quaternion and this function will save some computations.</td></tr>
  </table>
  </dd>
</dl>
<p>For example </p><div class="fragment"><div class="line"><a class="code" href="../../d0/de1/group__core.html#ga649715908b1dc7fc2496df48dd5fff64">Quatd</a> q(1,2,3,4);</div><div class="line"><a class="code" href="../../da/d4a/classcv_1_1Quat.html#ab25ed7498bc5db29de2db5b5378f981c">inv</a>(q);</div><div class="line"></div><div class="line"><a class="code" href="../../d0/de1/group__core.html#ga935c8234953e2a2c8557c019ad8d509e">QuatAssumeType</a> assumeUnit = <a class="code" href="../../d0/de1/group__core.html#gga935c8234953e2a2c8557c019ad8d509ea87af033c2248f7a0b4548ffa56afc697">QUAT_ASSUME_UNIT</a>;</div><div class="line">q = q.normalize();</div><div class="line"><a class="code" href="../../da/d4a/classcv_1_1Quat.html#ab25ed7498bc5db29de2db5b5378f981c">inv</a>(q, assumeUnit);<span class="comment">//This assumeUnit means p is a unit quaternion</span></div></div><!-- fragment --> 
</div>
</div>
<a id="abcbac5d77bec374fe764832f519af1c3"></a>
<h2 class="memtitle"><span class="permalink"><a href="#abcbac5d77bec374fe764832f519af1c3">&#9670;&nbsp;</a></span>log</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename _Tp&gt; </div>
<div class="memtemplate">
template&lt;typename T &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt;T&gt; log </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt; T &gt; &amp;&#160;</td>
          <td class="paramname"><em>q</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../d0/de1/group__core.html#ga935c8234953e2a2c8557c019ad8d509e">QuatAssumeType</a>&#160;</td>
          <td class="paramname"><em>assumeUnit</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">friend</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>return the value of logarithm function. </p><p class="formulaDsp">
\[\ln(q) = \ln||q|| + \frac{\boldsymbol{v}}{||\boldsymbol{v}||}\arccos\frac{w}{||q||}.\]
</p>
<p> where \(\boldsymbol{v} = [x, y, z].\) </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">q</td><td>a quaternion. </td></tr>
    <tr><td class="paramname">assumeUnit</td><td>if QUAT_ASSUME_UNIT, q assume to be a unit quaternion and this function will save some computations.</td></tr>
  </table>
  </dd>
</dl>
<p>For example </p><div class="fragment"><div class="line"><a class="code" href="../../d0/de1/group__core.html#ga649715908b1dc7fc2496df48dd5fff64">Quatd</a> q1{1,2,3,4};</div><div class="line">cout &lt;&lt; <a class="code" href="../../da/d4a/classcv_1_1Quat.html#abcbac5d77bec374fe764832f519af1c3">log</a>(q1) &lt;&lt; endl;</div></div><!-- fragment --> 
</div>
</div>
<a id="abf9dce8edb81bdce0d8c577b47a920d9"></a>
<h2 class="memtitle"><span class="permalink"><a href="#abf9dce8edb81bdce0d8c577b47a920d9">&#9670;&nbsp;</a></span>power <span class="overload">[1/2]</span></h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename _Tp&gt; </div>
<div class="memtemplate">
template&lt;typename T &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt;T&gt; power </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt; T &gt; &amp;&#160;</td>
          <td class="paramname"><em>q</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const T&#160;</td>
          <td class="paramname"><em>x</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../d0/de1/group__core.html#ga935c8234953e2a2c8557c019ad8d509e">QuatAssumeType</a>&#160;</td>
          <td class="paramname"><em>assumeUnit</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">friend</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>return the value of power function with index \(x\). </p><p class="formulaDsp">
\[q^x = ||q||(cos(x\theta) + \boldsymbol{u}sin(x\theta))).\]
</p>
 </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">q</td><td>a quaternion. </td></tr>
    <tr><td class="paramname">x</td><td>index of exponentiation. </td></tr>
    <tr><td class="paramname">assumeUnit</td><td>if QUAT_ASSUME_UNIT, quaternion q assume to be a unit quaternion and this function will save some computations.</td></tr>
  </table>
  </dd>
</dl>
<p>For example </p><div class="fragment"><div class="line"><a class="code" href="../../d0/de1/group__core.html#ga649715908b1dc7fc2496df48dd5fff64">Quatd</a> q(1,2,3,4);</div><div class="line"><a class="code" href="../../da/d4a/classcv_1_1Quat.html#abf9dce8edb81bdce0d8c577b47a920d9">power</a>(q, 2.0);</div><div class="line"></div><div class="line"><a class="code" href="../../d0/de1/group__core.html#ga935c8234953e2a2c8557c019ad8d509e">QuatAssumeType</a> assumeUnit = <a class="code" href="../../d0/de1/group__core.html#gga935c8234953e2a2c8557c019ad8d509ea87af033c2248f7a0b4548ffa56afc697">QUAT_ASSUME_UNIT</a>;</div><div class="line"><span class="keywordtype">double</span> angle = <a class="code" href="../../db/de0/group__core__utils.html#ga677b89fae9308b340ddaebf0dba8455f">CV_PI</a>;</div><div class="line"><a class="code" href="../../dc/d84/group__core__basic.html#ga370d94209693b5b13437ab4991cabf73">Vec3d</a> axis{0, 0, 1};</div><div class="line"><a class="code" href="../../d0/de1/group__core.html#ga649715908b1dc7fc2496df48dd5fff64">Quatd</a> q1 = <a class="code" href="../../da/d4a/classcv_1_1Quat.html#ab9b2bcb68e895895e61c826223e1ab55">Quatd::createFromAngleAxis</a>(angle, axis); <span class="comment">//generate a unit quat by axis and angle</span></div><div class="line"><a class="code" href="../../da/d4a/classcv_1_1Quat.html#abf9dce8edb81bdce0d8c577b47a920d9">power</a>(q1, 2.0, assumeUnit);<span class="comment">//This assumeUnit means q1 is a unit quaternion.</span></div></div><!-- fragment --> <dl class="section note"><dt>Note</dt><dd>the type of the index should be the same as the quaternion. </dd></dl>

</div>
</div>
<a id="aadec3e8895a41e97999d3d914064b3a7"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aadec3e8895a41e97999d3d914064b3a7">&#9670;&nbsp;</a></span>power <span class="overload">[2/2]</span></h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename _Tp&gt; </div>
<div class="memtemplate">
template&lt;typename T &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt;T&gt; power </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt; T &gt; &amp;&#160;</td>
          <td class="paramname"><em>p</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt; T &gt; &amp;&#160;</td>
          <td class="paramname"><em>q</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../d0/de1/group__core.html#ga935c8234953e2a2c8557c019ad8d509e">QuatAssumeType</a>&#160;</td>
          <td class="paramname"><em>assumeUnit</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">friend</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>return the value of power function with quaternion \(q\). </p><p class="formulaDsp">
\[p^q = e^{q\ln(p)}.\]
</p>
 </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">p</td><td>base quaternion of power function. </td></tr>
    <tr><td class="paramname">q</td><td>index quaternion of power function. </td></tr>
    <tr><td class="paramname">assumeUnit</td><td>if QUAT_ASSUME_UNIT, quaternion \(p\) assume to be a unit quaternion and this function will save some computations.</td></tr>
  </table>
  </dd>
</dl>
<p>For example </p><div class="fragment"><div class="line"><a class="code" href="../../d0/de1/group__core.html#ga649715908b1dc7fc2496df48dd5fff64">Quatd</a> p(1,2,3,4);</div><div class="line"><a class="code" href="../../d0/de1/group__core.html#ga649715908b1dc7fc2496df48dd5fff64">Quatd</a> q(5,6,7,8);</div><div class="line"><a class="code" href="../../da/d4a/classcv_1_1Quat.html#abf9dce8edb81bdce0d8c577b47a920d9">power</a>(p, q);</div><div class="line"></div><div class="line"><a class="code" href="../../d0/de1/group__core.html#ga935c8234953e2a2c8557c019ad8d509e">QuatAssumeType</a> assumeUnit = <a class="code" href="../../d0/de1/group__core.html#gga935c8234953e2a2c8557c019ad8d509ea87af033c2248f7a0b4548ffa56afc697">QUAT_ASSUME_UNIT</a>;</div><div class="line">p = p.normalize();</div><div class="line"><a class="code" href="../../da/d4a/classcv_1_1Quat.html#abf9dce8edb81bdce0d8c577b47a920d9">power</a>(p, q, assumeUnit); <span class="comment">//This assumeUnit means p is a unit quaternion</span></div></div><!-- fragment --> 
</div>
</div>
<a id="a5391c041a71697dea04a1532a29494d9"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a5391c041a71697dea04a1532a29494d9">&#9670;&nbsp;</a></span>sin</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename _Tp&gt; </div>
<div class="memtemplate">
template&lt;typename T &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt;T&gt; sin </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt; T &gt; &amp;&#160;</td>
          <td class="paramname"><em>q</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">friend</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>return tanh value of quaternion q, sin could be calculated as: </p><p class="formulaDsp">
\[\sin(p) = \sin(w) * \cosh(||\boldsymbol{v}||) + \cos(w)\frac{\boldsymbol{v}}{||\boldsymbol{v}||}\sinh(||\boldsymbol{v}||)\]
</p>
<p> where \(\boldsymbol{v} = [x, y, z].\) </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">q</td><td>a quaternion.</td></tr>
  </table>
  </dd>
</dl>
<p>For example </p><div class="fragment"><div class="line"><a class="code" href="../../d0/de1/group__core.html#ga649715908b1dc7fc2496df48dd5fff64">Quatd</a> q(1,2,3,4);</div><div class="line"><a class="code" href="../../da/d4a/classcv_1_1Quat.html#a88d9b4b0497741ba741118fb9c626ed7">sin</a>(q);</div></div><!-- fragment --> 
</div>
</div>
<a id="a10fa75e217469cba4bac9c7f743e3031"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a10fa75e217469cba4bac9c7f743e3031">&#9670;&nbsp;</a></span>sinh</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename _Tp&gt; </div>
<div class="memtemplate">
template&lt;typename T &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt;T&gt; sinh </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt; T &gt; &amp;&#160;</td>
          <td class="paramname"><em>q</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">friend</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>return sinh value of quaternion q, sinh could be calculated as: </p><p class="formulaDsp">
\[\sinh(p) = \sin(w)\cos(||\boldsymbol{v}||) + \cosh(w)\frac{v}{||\boldsymbol{v}||}\sin||\boldsymbol{v}||\]
</p>
<p> where \(\boldsymbol{v} = [x, y, z].\) </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">q</td><td>a quaternion.</td></tr>
  </table>
  </dd>
</dl>
<p>For example </p><div class="fragment"><div class="line"><a class="code" href="../../d0/de1/group__core.html#ga649715908b1dc7fc2496df48dd5fff64">Quatd</a> q(1,2,3,4);</div><div class="line"><a class="code" href="../../da/d4a/classcv_1_1Quat.html#a541f79fd2e9a99ac7cd39ebd499eca65">sinh</a>(q);</div></div><!-- fragment --> 
</div>
</div>
<a id="a9c0ae34d84de01762207d330c98d3618"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a9c0ae34d84de01762207d330c98d3618">&#9670;&nbsp;</a></span>sqrt</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename _Tp&gt; </div>
<div class="memtemplate">
template&lt;typename T &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt;T&gt; sqrt </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt; T &gt; &amp;&#160;</td>
          <td class="paramname"><em>q</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../d0/de1/group__core.html#ga935c8234953e2a2c8557c019ad8d509e">QuatAssumeType</a>&#160;</td>
          <td class="paramname"><em>assumeUnit</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">friend</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>return \(\sqrt{q}\). </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">q</td><td>a quaternion. </td></tr>
    <tr><td class="paramname">assumeUnit</td><td>if QUAT_ASSUME_UNIT, quaternion q assume to be a unit quaternion and this function will save some computations.</td></tr>
  </table>
  </dd>
</dl>
<p>For example </p><div class="fragment"><div class="line"><a class="code" href="../../d0/de1/group__core.html#gab0a5d5b9880b016c8995411a572353e2">Quatf</a> q(1,2,3,4);</div><div class="line"><a class="code" href="../../da/d4a/classcv_1_1Quat.html#a9c0ae34d84de01762207d330c98d3618">sqrt</a>(q);</div><div class="line"></div><div class="line"><a class="code" href="../../d0/de1/group__core.html#ga935c8234953e2a2c8557c019ad8d509e">QuatAssumeType</a> assumeUnit = <a class="code" href="../../d0/de1/group__core.html#gga935c8234953e2a2c8557c019ad8d509ea87af033c2248f7a0b4548ffa56afc697">QUAT_ASSUME_UNIT</a>;</div><div class="line">q = {1,0,0,0};</div><div class="line"><a class="code" href="../../da/d4a/classcv_1_1Quat.html#a9c0ae34d84de01762207d330c98d3618">sqrt</a>(q, assumeUnit); <span class="comment">//This assumeUnit means q is a unit quaternion.</span></div></div><!-- fragment --> 
</div>
</div>
<a id="ab76e4322ad61dfb44dfc78a09d8c5c7e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ab76e4322ad61dfb44dfc78a09d8c5c7e">&#9670;&nbsp;</a></span>tan</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename _Tp&gt; </div>
<div class="memtemplate">
template&lt;typename T &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt;T&gt; tan </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt; T &gt; &amp;&#160;</td>
          <td class="paramname"><em>q</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">friend</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>return tan value of quaternion q, tan could be calculated as: </p><p class="formulaDsp">
\[\tan(q) = \frac{\sin(q)}{\cos(q)}.\]
</p>
 </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">q</td><td>a quaternion.</td></tr>
  </table>
  </dd>
</dl>
<p>For example </p><div class="fragment"><div class="line"><a class="code" href="../../d0/de1/group__core.html#ga649715908b1dc7fc2496df48dd5fff64">Quatd</a> q(1,2,3,4);</div><div class="line"><a class="code" href="../../da/d4a/classcv_1_1Quat.html#ade63bd7caefaf41312013f6529b50902">tan</a>(q);</div></div><!-- fragment --> 
</div>
</div>
<a id="adfb2cae03ff36e40255d24195d9dad0d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#adfb2cae03ff36e40255d24195d9dad0d">&#9670;&nbsp;</a></span>tanh</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename _Tp&gt; </div>
<div class="memtemplate">
template&lt;typename T &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt;T&gt; tanh </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="../../da/d4a/classcv_1_1Quat.html">Quat</a>&lt; T &gt; &amp;&#160;</td>
          <td class="paramname"><em>q</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">friend</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>return tanh value of quaternion q, tanh could be calculated as: </p><p class="formulaDsp">
\[ \tanh(q) = \frac{\sinh(q)}{\cosh(q)}.\]
</p>
 </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">q</td><td>a quaternion.</td></tr>
  </table>
  </dd>
</dl>
<p>For example </p><div class="fragment"><div class="line"><a class="code" href="../../d0/de1/group__core.html#ga649715908b1dc7fc2496df48dd5fff64">Quatd</a> q(1,2,3,4);</div><div class="line"><a class="code" href="../../da/d4a/classcv_1_1Quat.html#a7f10eb9756915c30697c2536dc9107f8">tanh</a>(q);</div></div><!-- fragment --> <dl class="section see"><dt>See also</dt><dd><a class="el" href="../../da/d4a/classcv_1_1Quat.html#a10fa75e217469cba4bac9c7f743e3031" title="return sinh value of quaternion q, sinh could be calculated as:  where  ">sinh</a>, <a class="el" href="../../da/d4a/classcv_1_1Quat.html#a8055944f530299760c54693f172050b4" title="return cosh value of quaternion q, cosh could be calculated as:  where  ">cosh</a> </dd></dl>

</div>
</div>
<h2 class="groupheader">Member Data Documentation</h2>
<a id="ad8f52c20247c809ca07935f41edce618"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ad8f52c20247c809ca07935f41edce618">&#9670;&nbsp;</a></span>CV_QUAT_CONVERT_THRESHOLD</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename _Tp&gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">constexpr _Tp <a class="el" href="../../da/d4a/classcv_1_1Quat.html">cv::Quat</a>&lt; _Tp &gt;::CV_QUAT_CONVERT_THRESHOLD = (_Tp)1.e-6</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

</div>
</div>
<a id="a10e3525ee098693c55b6ec47a9ac6c11"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a10e3525ee098693c55b6ec47a9ac6c11">&#9670;&nbsp;</a></span>CV_QUAT_EPS</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename _Tp&gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">constexpr _Tp <a class="el" href="../../da/d4a/classcv_1_1Quat.html">cv::Quat</a>&lt; _Tp &gt;::CV_QUAT_EPS = (_Tp)1.e-6</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

</div>
</div>
<a id="af261492a691c1f0ae62708564b2f1021"></a>
<h2 class="memtitle"><span class="permalink"><a href="#af261492a691c1f0ae62708564b2f1021">&#9670;&nbsp;</a></span>w</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename _Tp&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">_Tp <a class="el" href="../../da/d4a/classcv_1_1Quat.html">cv::Quat</a>&lt; _Tp &gt;::w</td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a id="ab2fbcb463f79a6b9de87c440e3c09dc7"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ab2fbcb463f79a6b9de87c440e3c09dc7">&#9670;&nbsp;</a></span>x</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename _Tp&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">_Tp <a class="el" href="../../da/d4a/classcv_1_1Quat.html">cv::Quat</a>&lt; _Tp &gt;::x</td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a id="a7fec2f7d0b5928826dd359773643ecdc"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a7fec2f7d0b5928826dd359773643ecdc">&#9670;&nbsp;</a></span>y</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename _Tp&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">_Tp <a class="el" href="../../da/d4a/classcv_1_1Quat.html">cv::Quat</a>&lt; _Tp &gt;::y</td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a id="a6836f50dd74292ad753a51a906200af2"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a6836f50dd74292ad753a51a906200af2">&#9670;&nbsp;</a></span>z</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename _Tp&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">_Tp <a class="el" href="../../da/d4a/classcv_1_1Quat.html">cv::Quat</a>&lt; _Tp &gt;::z</td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li>opencv2/core/<a class="el" href="../../db/d65/quaternion_8hpp.html">quaternion.hpp</a></li>
</ul>
</div><!-- contents -->
<!-- HTML footer for doxygen 1.8.6-->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Fri Apr 2 2021 11:36:43 for OpenCV by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="../../doxygen.png" alt="doxygen"/>
</a> 1.8.13
</small></address>
<script type="text/javascript">
//<![CDATA[
addTutorialsButtons();
//]]>
</script>
</body>
</html>
